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

Limit items owned #8

Open
Federe76 opened this issue May 21, 2020 · 4 comments
Open

Limit items owned #8

Federe76 opened this issue May 21, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@Federe76
Copy link

Main idea: To be able to limit or even disable the pickup of some items, increasing their rarity and value (example: Elytras, Ench. Apples, Beacons). This would allow server admins to reward players with rare items and make them more special.

Some idea of how it would work:

limited items:

  • Elytra: 1
  • Enchanted Golden Apple: 2
  • Beacon: 0
  • Wither Skeleton Skull: 3

The plugin checks if the player has previously picked up those items, and prevents them from being picked up if the limit has been reached. These checks would also need to consider inventory transfers (chests, hoppers, etc.) so players can't withdraw items past the set limit.

The amount of "owned" items goes up everytime the player picks up that item, and goes down when the item is consumed in any way (gets eaten, is dropped on death, etc.)

The limits which I haven't yet decided on how to prevent:
• Placing hoppers and storing items would let players somehow get the items even when they themselves can't pick them up.
• Legal item transfers, like trading plugins.

Possible preventions for the limits:
• Limited items won't pass through hoppers.

@Silthus Silthus added the enhancement New feature or request label May 21, 2020
@Silthus Silthus self-assigned this May 21, 2020
@Silthus
Copy link
Collaborator

Silthus commented Jun 9, 2020

What should happen if someone places the item in a chest? How could we handle this?
One way would be to somehow tag the item and only allow pickups from the owner.

@Federe76
Copy link
Author

This is something I have thought about without getting a clear idea on how to proceed.
If that tagging is possible, that would be a way.
Example (a player can only own 2 Elytras)
• The player attempts to pick up an Elytra
• Check if the Elytra is owned by anyone (tagged)
• If not tagged, then check if the player has 2 Elytras "registered" to their name
• If the player has less than 2 owned Elytras, the player successfully picks up the Elytra and tags it as "owned by ( )"
If this chain of events is possible, next steps would be.
○ Make it so items on the ground can't be picked up by hoppers
○ Think of a way for players to exchange limited items. The one giving the item away gets their "owned" amount reduced and the one recieving the item gets their amount increased. Of course this exchange could only happen in the first place if the one recieving hasn't reached the limit.

@Silthus
Copy link
Collaborator

Silthus commented Jun 10, 2020

Why is this hopper thing such a problem? The method I want to use persists the information directly on the item and can be transfered in any way.

So based on you answer I think I will provide the following options for item transfers:

  • preventing owned items to be picked up by any other player
  • owned items can be picked up by other players transferring the ownership
  • a hybrid between the first two: a command to explicitly transfer owned items to other players

One more thing that came to mind: what should happen if those items can be ingredients in recipes and crafted "away". Should this be prevented?

@Federe76
Copy link
Author

On the hoppers issue, I keep thinking of it because it could be used as a workaround for players to get more items even with the plugin installed. Elytras wouldn't be the problem but, let's say the server admin wants to limit wither skeleton skulls or beacons.
Example: The player sets up a way to summon a wither a kill it within a certain area. The player then sets hoppers to transfer the nether star to a storage system without ever picking it up. This way they could transfer it to a shulker box, and carry or sell that shulker box without ever having the actual star in their inventory.
This is all just brainstorming on ways players will try to "cheat" around the plugin xD.

About the options, the second one is very interesting because that would force players to be careful about who they trust around their items. The first one I think would prevent any type of trade between players. And the last one would mean the players don't have to worry about someone else searhing through their stuff. If possible, the plugin would have configuration option to choose between option 2 and 3, but to keep it simple, I would go with option 2.

On the ingredients for recipes thing, I hadn't thought of that aspect. Is there a way to check when the item is "consumed" for crafting? This would be my first option, when if the item is consumed, reduce by one the amount of owned items (and let admins think of what crafting ingredients/results they'll limit). Another way would be to prevent obtaining items through crafting if they are limited. Going back to the beacons example, let's say players have these limits:
Beacon: 1
Nether Star: 1
Is there a way to prevent a player from crafting a second beacon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants