Advertisement
Cool_boy21

merchant

Apr 21st, 2017
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.85 KB | None | 0 0
  1. @EventHandler
  2.     public void interr(PlayerInteractEvent event) {
  3.         Player player = event.getPlayer();
  4.         if (event.getAction().equals(Action.RIGHT_CLICK_AIR)&&event.getItem().getType().equals(Material.STICK)){
  5.             Merchant m = Bukkit.createMerchant(ChatColor.GREEN + "Ресурси");
  6.             ItemStack stack = new ItemStack(Material.STONE,5);
  7.             MerchantRecipe recipe1 = new MerchantRecipe(stack,20);
  8.             recipe1.addIngredient(new ItemStack(Material.WOOD_PLATE,2));
  9.            
  10.             ItemStack stack2 = new ItemStack(Material.TNT,5);
  11.             MerchantRecipe recipe2 = new MerchantRecipe(stack2,20);
  12.             recipe2.addIngredient(new ItemStack(Material.STONE_AXE,1));
  13.            
  14.             m.setRecipes(Arrays.asList(recipe1,recipe2));
  15.             player.openMerchant(m, true);
  16.         }
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement