Can I print the name of the item I killed someone with?
So if somebody would kill you, and you want the item name from that, do it:
(Event.getEntity () getKiller () GetInventory () getItemInMainHand () getItemMeta) getDisplayName ()… ;
Note, however, that items that have no set name will always return zero for the function.
And how is it with mobs? Is that okay? :
else if (! (p.getKiller () instanceof Player)) {
e.setDeathMessage ("§e" + p.getName () + "§b was killed by §e" + e.getEntity (). GetKiller (). GetType (). ToString (). ToUpperCase () + "§b. ");
}
Should go like this