Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is an example of what I can do for the wreckage, I just decided to make this simple and easy. This is when somebody right clicks a WOOL block it will open a double chest of soup and the chest's inventory name will be 'Wreckage Soup' in the color purple and, when somebody right clicks the wool it will play a 'ding' sound.
- @EventHandler(priority = EventPriority.HIGH)
- public void Chest(PlayerInteractEvent e) {
- if ((e.getAction() == Action.RIGHT_CLICK_BLOCK)
- && (e.getClickedBlock().getType() == Material.WOOL)) {
- Inventory soup = Bukkit.createInventory(null, 54, ChatColor
- .translateAlternateColorCodes('&', "§5Wreckage Soup"));
- for (int i = 0; i < 54; i++) {
- soup.addItem(new ItemStack[] { new ItemStack(Material.MUSHROOM_SOUP) });
- }
- e.setCancelled(true);
- e.getPlayer().playSound(e.getPlayer().getLocation(),
- Sound.NOTE_PLING, 1, 0);
- e.getPlayer().openInventory(soup);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement