I've been working on a mod, and I've come to a roadblock. I'm trying to figure out how to give the player an item when they spawn in the world. BUT, I want to give them the item only if this is their first time spawning or they just died. I've tried using LivingSpawnEvent, but that doesn't work for players. EntityJoinWorldEvent kind of worked, but it gives the player the item whenever they log in, while I want them to get the item only on their first spawn or after dying. Is there an easy way to achieve this?
I figured out how to do it. For anyone who has this issue, use EntityJoinWorldEvent with an EntityPlayer IExtendedEntityProperty to determine whether the player has logged in before.
I've been working on a mod, and I've come to a roadblock. I'm trying to figure out how to give the player an item when they spawn in the world. BUT, I want to give them the item only if this is their first time spawning or they just died. I've tried using LivingSpawnEvent, but that doesn't work for players. EntityJoinWorldEvent kind of worked, but it gives the player the item whenever they log in, while I want them to get the item only on their first spawn or after dying. Is there an easy way to achieve this?
I figured out how to do it. For anyone who has this issue, use EntityJoinWorldEvent with an EntityPlayer IExtendedEntityProperty to determine whether the player has logged in before.