Trigger "Respawn" and flag "Self-drops" work the same way
Daniil6622 opened this issue · 4 comments
Sorry, but I'm not very good at English, so I described everything succinctly.
Please describe your question or what you need help with, in the best detain you can.
Trigger "Respawn" should set the number of elements in inventory after any death. It does this.
Flag "Self-drops" should (according to wiki) save the number of elements after death, but it works the same way as "Respawn".
Server
Plugin version: 5,2,5
Core: Spigot-1.19.X
Apologies for the late reply,
I am a bit confused as you listed two entirely different things that do not correlate in description, especially when viewing the wiki;
death-drops - Clears this item if it is dropped on the ground when the player dies. This itemflag will respect the /gamerule keepInventory value, so if it's set to true then the death-drops itemflag will be disabled.
self-drops - Prevents the player from dropping this item, either clicking it out of inventory or using the drop key, usually (q).
So this shows the item is prevented from being dropped via death for death-drops or being manually dropped by the player via self-drops.
As for the respawn trigger it simply gives the item back to the player on respawn.
So to clarify there is no flag/trigger that "saves" items on death, you simply can specify the respawn itemflag to have them returned on respawn.
I hope that makes sense, I may be misunderstanding what you are saying.
I seem to have confused it.
How it works? death-keep - Retains the custom item on-death so it will exist in the player's inventory upon respawn.
I think I wanted to write "death-keep instead of "self-drops".
Ah I see, so yeah death-keep basically is just a fancy respawn trigger. The only difference is that this itemflag bypasses some restrictions to basically "force" the player to have the item upon respawn. Currently, due to Spigot API limitations the death-keep itemflag does not keep any active changes such as if you enchanted a pickaxe or if it took durability damage if that makes sense.
There is an active feature request on this though and I have been actively working on my own method to log the changed made to items so they can be re-given on respawn with the proper attributes for the death-keep itemflag. Since the only way to prevent items from being removed or dropped on death using the Spigot API is the gamerule keepInventory command.
Hopefully, that clarifies some things.