Catch Items before Deletion?

Discussion in 'Plugin Requests' started by LewisMiles, Nov 5, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    LewisMiles

    Plugin category: Fun?

    Minecraft version: 1.16+

    Suggested name: FiniteMatter

    What I’d like it to do: Before items on the ground despawn or when they fall into lava or a cactus extra. The same item gets teleported into a specific chest or xyz for a hopper to collect set by the Admin for them to resell back to the players.

    I don’t like the idea of admin shops just creating items out of thin air and would prefer if I could collect all the items players let despawn or lose back to the masses who need them.

    Ideas for commands: Admin command to specify which chest or xyz location to transport all despawned or deleted items to.
    appvalley tutuapp tweakbox

    Ideas for permissions: Only ops should be able to use the above command.

    When I'd like it by: Soon.
     
    Last edited: Nov 5, 2020
  2. Offline

    CraftCreeper6

    @LewisMiles
    Chests have a limited size, would it not make sense to just store them in some form of file? And what about items with enchantments, how do you expect to make them filter from the unenchanted variants once they are sold? What about damaged items? Do they cost less? If so by how much? Do you want an item filter so that this plugin will only pick up items that don't have a durability value such as diamonds and iron? Or do you want EVERYTHING to be picked up? What if a player wants to buy back their shulker box that they lost, how will you sell it back to them if all you have is a sign that says shulker box on it? It could be anyones.
     
  3. Offline

    feazeyu

    I believe this all could be solved with storing them in a file, as you said, and then creating a GUI shop like /ah plugins use. However @LewisMiles would have to edit the config for hours to set prices for every item how he'd like them.
     
  4. Offline

    CraftCreeper6

    @feazeyu
    Not to mention shulkers, how would you determine the price of a shulker? What if it has 1000 diamonds in it? Would you count up all the diamonds and their price and add on the cost of a shulker or would you just have a base shulker price?
     
  5. Offline

    bitfreeze.dev

    <removed>
     
    Last edited: Nov 17, 2020
  6. Offline

    Mathias Eklund

    I like the idea of items being purchasable after they despawn, and it probably isn't that hard to create.

    You'd simply have to listen to the ItemSpawnEvent, which I believe is called every time an item entity is spawned on the server. Set it to never despawn, and add it to a List, then simply have a scheduled task that runs every X minutes that collect all the entities from that list, removes them and adds the item stacks to wherever it needs to go.
    It would probably also be a good idea to remove the entities from the list if the item is picked up by a player.
     
  7. Offline

    CraftCreeper6

    @Mathias Eklund
    Alternatively, ItemDespawnEvent, though with this method you would be required to check things like if the item falls into lava, if it falls through the void, all sorts.
     
  8. Offline

    Mathias Eklund

    @CraftCreeper6 To be honest, I didn't even know that even existed. The more you know :)
     
Thread Status:
Not open for further replies.

Share This Page