Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config option to keep picked up items #750

Open
Fisher2911 opened this issue Oct 13, 2022 · 1 comment
Open

Config option to keep picked up items #750

Fisher2911 opened this issue Oct 13, 2022 · 1 comment
Labels
area/restoration Saving and restoring state of players, arenas, etc. area/sessions Related to how arena sessions run, e.g. wave setup, the lobby, spectating, event isolation, etc. rework/restoration Relevant to the restoration rework effort. rework/sessions Relevant to the sessions rework effort. type/enhancement New or improved feature.

Comments

@Fisher2911
Copy link

Feature request

Short description

A config option to allow dropped items in arenas to be kept when the player is done with the arena.

Implementation details

It would add a new config option (or something similar)

keep-dropped-items

This would give the option for players to keep items that they picked up in game. How it could work:
Adding an NBT Tag / PDC Data to each item that was in the player's inventory when they joined. At the end of the round,
remove all those items from their inventory, store the rest of the items in a list, restore their inventory from the start, then add back the items stored in the list.

Additional info
I should be able to do this and make a PR.

@garbagemule garbagemule added type/enhancement New or improved feature. area/restoration Saving and restoring state of players, arenas, etc. rework/restoration Relevant to the restoration rework effort. area/sessions Related to how arena sessions run, e.g. wave setup, the lobby, spectating, event isolation, etc. rework/sessions Relevant to the sessions rework effort. labels Feb 18, 2023
@garbagemule
Copy link
Owner

There's a lot of "tension" between this suggestion and the intended role of the plugin. MobArena is designed to be an isolated minigame that has a "separate track" of rewards that can be unlocked by certain milestones (only waves, really, but the intention was always to add more types; referencing #734 and #754 for good measure). Like how a shooting gallery at a carnival works. You don't really pick anything up during the game, but you score points or hit certain targets that unlock rewards that you then get after the game is over.

Introducing a concept of inventory persistence breaks that isolation. Making it configurable via just a boolean flag is probably not going to cut it. For instance, the default Oddjob class has Netherrack blocks to use with the Flint and Steel to make fire pits. It also carries TNT blocks to blow stuff up. Should players be able to bring those placed blocks and blown up blocks out of the arena if they pick them up? Even if we were to use NBTs, do they transfer from item to block automatically?

I recall someone mentioning using the /ma addreward command to do something similar to this. Picking up certain items would trigger some event for a separate script or plugin that would invoke the reward command for the given player. I much prefer this type of approach because it shifts the responsibility of "covering all bases" from the plugin to the server admin and hopefully makes for much more flexible and extensible solutions. This obviously wouldn't work if the items being picked up are consumable, so if you pick up 10 items and consume 8, you should only leave with 2.

Could you share some more information about what you're trying to achieve specifically? Perhaps breaking the isolation is the actual goal here, in which case there may be a much better solution. Maybe in a "completely integrated" setup, players would just bring their own items into a "fixed session" arena that can be "finished", in which case they would get to walk out of the arena with all items in their inventory. But perhaps you're looking for something in between? What are these drops you want players to pick up, and why are they even there in the first place (MobArena clears monster drops by default, so there shouldn't actually be anything to pick up)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/restoration Saving and restoring state of players, arenas, etc. area/sessions Related to how arena sessions run, e.g. wave setup, the lobby, spectating, event isolation, etc. rework/restoration Relevant to the restoration rework effort. rework/sessions Relevant to the sessions rework effort. type/enhancement New or improved feature.
Projects
None yet
Development

No branches or pull requests

2 participants