Started by
Reandom
on
Topic category: Advanced modding
I want to make it so that when the ExitWorld game rule is active, when the Player leaves the server, an NPC takes his place, and when another player kills this NPC, it drops all the items from the Player's inventory, and when he returns to the server (if another player killed him) he appears at his spawnpoint without the items
It's very annoying. You will need to make so many player variables (you will need to make 36 + offhand slot + armors slot = 41 slot, you will need to make 41 itemstack variable) to store every item the player has in it. Then somehow save these items as registry names in a string NBT for the NPC. When the NPC dies. It checks what registry names it has in its NBT then it will drop it.