Is it possible to have players lose backpack on death when they are sleeping but keep then on death when playing
Allow looting backpacks of sleeping playersSuggestion
Basically I want their backpack to be looted while sleeping before being killed , true /false option but while awake if the die it is restored but have the option to turn that off so they can keep it also when sleeping and when awake upon death.
I'm having trouble understanding why you would want this behavior. So far, it doesn't sound like it would be useful to that many people, and it sounds complicated to implement, so this is probably going to be a No Thanks. However, in such scenarios, I don't want to block you from having the functionality, nor force you to fork the plugin (since that creates more work for people to maintain that fork), so I'd like to enable the possibility via hooks so that a simple add-on plugin could be implemented to do what you want, assuming we can nail down the ideal user experience.
Based on your second post, it sounds like the feature you want is to allow players to loot the backpack of a sleeping player, if a config option is enabled. The question I have is, how do you expect the looter to interface with the backpack?
Idea #1: When the player falls asleep, a backpack entity drops next to them, which players can loot directly. Upon waking up, the backpack would disappear and the remaining items would still be in the player's backpack (minus the ones that players removed while the player was asleep). Upon dying in the sleeping state, the backpack would remain on the ground with all of the player's items.
Idea #2: When the player falls asleep, there is no backpack visible, but when someone is looting their corpse, a GUI button appears to loot the sleeping palyer's backpack.
The first idea is likely to have quite a few edge cases to implement around container lifecycle, compatibility with plugins that try to remove entities, plugin reloads, server restarts, etc., so you don't want a noob developer, especially somebody unfamiliar with the backpacks code, to implement this. The second idea has some of the same problems and a few others (GUI handling, compatibility with zone manager flags) but might be easier.
I have players that would like to keep their backback when they die which is an option , but i dont allow it on my pvp server. I told them if their was a way to have it when another player loots the sleeping player they would not just see their invertorry but also their backpack i would . That way when they die in combate they keep their backpacks just like they keep their invertory ,but if they are sleeping the other player can loot their backpack just like their man invertory before killing them which would keep their backpack from restoring upon death . I understand if thats way to aggrevating or useless to implentment , i was just asking if their was an option or an implentmented flag for that option if it did exist.
There's no existing feature like that. I'll leave this thread open as a suggestion so that others can chime in if they would like to see the feature, or if they would like to help design/implement it.
WhiteThunder
Idea #2: When the player falls asleep, there is no backpack visible, but when someone is looting their corpse, a GUI button appears to loot the sleeping palyer's backpack.
This would be best if possible.