Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onDeathEntityDropHead(EntityDeathEvent e) {
- if (!(e.getEntity() instanceof Player)) {
- LivingEntity mob = e.getEntity();
- if (getEntity.get(mob)) {
- int lootin = 1;
- if (e.getEntity().getKiller() instanceof Player) {
- Player p = e.getEntity().getKiller();
- ItemStack item = p.getItemInHand();
- if (item.hasItemMeta() && item.getItemMeta().hasEnchant(Enchantment.LOOT_BONUS_MOBS))
- lootin = item.getEnchantmentLevel(Enchantment.LOOT_BONUS_MOBS);
- }
- mob.getWorld().dropItem(mob.getLocation(),
- new ItemBuilder(Material.SKULL_ITEM).setDurability(3).setAmount(1 * lootin)
- .setOwner(getOwner.get(mob)).setName("§dCabeça de " + getNameSkull.get(mob))
- .addLore("§aTipo: §7" + getTypeRank.get(mob), "",
- "§aPreço: §7" + getPriceRank.get(mob) + " coins")
- .construct());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement