Best way to add Towny compatibility for my death/graves plugin? #7904
-
|
Hello! I have a plugin that spawns a "player grave" when a player dies and I'm trying to solve this issue. My initial thought was I'll just listen for Towny's Is there some other way to solve this? Do I need to manually check if the player has the towny settings for keep inventory and if they are in a town etc... or is there some utility function I could use to check if the player were to die, if they'd keep their inventory? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Otherwise my plugin does have an API for cancelling the soul's spawn which Towny could cancel: https://github.com/FaultyFunctions/SoulGraves/blob/main/src/main/kotlin/dev/faultyfunctions/soulgraves/api/event/SoulPreSpawnEvent.kt I'm not sure which way the compatibility should be implemented. |
Beta Was this translation helpful? Give feedback.
-
|
OK, I've reviewed your listener and found you're on the normal priority, so your plugin is ignoring anything that happens further down the line on HIGH and HIGHEST. Being that it is the PlayerDeathEvent I think you should probably be listening on MONITOR and then you'll know for sure if the players are going to be keeping their inventory. You certainly don't want to remain on NORMAL though because you're blind to anything that comes after. |
Beta Was this translation helpful? Give feedback.
OK, I've reviewed your listener and found you're on the normal priority, so your plugin is ignoring anything that happens further down the line on HIGH and HIGHEST.
Being that it is the PlayerDeathEvent I think you should probably be listening on MONITOR and then you'll know for sure if the players are going to be keeping their inventory.
You certainly don't want to remain on NORMAL though because you're blind to anything that comes after.