Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1.  
  2. @EventHandler
  3. public void onPlayerInteract(PlayerInteractEvent e) {
  4. Player p = e.getPlayer();
  5. Action action = e.getAction();
  6.  
  7. if (e.getAction() == Action.RIGHT_CLICK_BLOCK){
  8. if (e.getClickedBlock().getType() == Material.REDSTONE_BLOCK) {
  9. if(p.getInventory().contains(Material.GOLD_NUGGET, 2)){
  10. p.sendMessage(prefix+"Tu as acheté une boisson Juggernog");
  11. p.getInventory().addItem(new ItemStack(Material.POTION, 1, (byte)14 ));
  12. }else{
  13. p.sendMessage(prefix+"&cTu n'as pas asser pour acheter une boisson Juggernog");
  14. }
  15.  
  16. }
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement