Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void interr(PlayerInteractEvent event) {
- Player player = event.getPlayer();
- if (event.getAction().equals(Action.RIGHT_CLICK_AIR)&&event.getItem().getType().equals(Material.STICK)){
- Merchant m = Bukkit.createMerchant(ChatColor.GREEN + "Ресурси");
- ItemStack stack = new ItemStack(Material.STONE,5);
- MerchantRecipe recipe1 = new MerchantRecipe(stack,20);
- recipe1.addIngredient(new ItemStack(Material.WOOD_PLATE,2));
- ItemStack stack2 = new ItemStack(Material.TNT,5);
- MerchantRecipe recipe2 = new MerchantRecipe(stack2,20);
- recipe2.addIngredient(new ItemStack(Material.STONE_AXE,1));
- m.setRecipes(Arrays.asList(recipe1,recipe2));
- player.openMerchant(m, true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement