Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void OnThrow(PlayerEggThrowEvent e) {
- Player player = e.getPlayer();
- Entity cow = player.getWorld().spawnEntity(e.getEgg().getLocation(), EntityType.COW);
- cow.setCustomName(ChatColor.RED + "Mama");
- cow.setCustomNameVisible(true);
- if (player.getInventory().getItemInMainHand().getType() == (Material.EGG)) {
- if (player.getInventory().getItemInMainHand().getItemMeta() != null) {
- if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName() != null) {
- if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals("Cow Egg")) {
- player.getWorld().spawnEntity(e.getEgg().getLocation(), EntityType.COW);
- } if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals("Egg")) {
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment