Death Golden Apple Drops then rename HELP

Discussion in 'Plugin Development' started by Jarglax, Aug 5, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Jarglax

    Fixed myself
     
  2. Offline

    Gater12

    Jarglax
    Why not just create an ItemStack w/ ItemMeta for display name and drop that?
     
  3. Offline

    candyfloss20

    Jarglax, Try this dude:

    Code:java
    1. @EventHandler
    2. public void onDeath(PlayerDeathEvent e) {
    3. Player killer = e.getEntity().getPlayer().getKiller();
    4. Player Player_That_Got_Killed = e.getEntity().getPlayer();
    5.  
    6. ItemStack TheGoldApple = new ItemStack(Material.GOLDEN_APPLE,1,(short)1); //(short)1 make it a God Apple remove for normal gold apple
    7. ItemMeta TheGoldAppleM = TheGoldApple.getItemMeta();
    8. List<String> TheGoldAppleL = new ArrayList<String>(); TheGoldAppleL.add("I Take A String, Im The Item Desc (Lore)");
    9. TheGoldAppleM.setLore(TheGoldAppleL);
    10. TheGoldAppleM.setDisplayName(Player_That_Got_Killed.getName()+"'s Soul");//Might wanna rename that xD
    11. TheGoldApple.setItemMeta(TheGoldAppleM);
    12. e.getDrops().add(TheGoldApple);
    13. }
     
Thread Status:
Not open for further replies.

Share This Page