1.12.2 NMS Player drops equipment after death

Discussion in 'Spigot Plugin Development' started by blackone1991, Jan 24, 2020.

  1. Hey, I made a code that disguise entity to EntityPlayer after that it sends packet equip armors EntityPlayer. Everything is normal about that and works fine. However, when disguised entity deaths, the fake armors drop around the entity, no one can pick up items 'cause these are fake. In my opinion, there is a DataWacther tag for that but I could not find it.
  2. I don't think there is a data tag for that (cmiiw). Could you maybe try to remove items before it dies? Does any kind of packet get sent to the server, before the NPC's death? And if so could you maybe react to that packet by removing all items from the NPC's inventory?
  3. I'm thinking about if there is over 50 players, I have to send packet all of them. What will happen I do not know and kill event maybe so slow to remove disguised entity's armor content. Should I try control his health with packet and before the last hit remove entity's inventory?
  4. This is what I would do. Instead of on the death event, catch in an EntityDamageByEntity event, and check if entity's health - e.getFinalDamage() <= 0, and if it is just remove the gear.
    • Useful Useful x 1