ChestPopulator, populate chests within a world

Discussion in 'Plugin Requests' started by Dark_Serpent, Jun 22, 2016.

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

    Dark_Serpent

    Plugin category: Mechanics

    Suggested name: ChestPopulator

    What I want: I would like to chests in chunks to be generated to be populated with items as defined in a config. There will be two configs ideally, 'items' and 'config'.

    The items config will contain every item that the populator can read from. You'll add items to this area using either the "/chestpopulator additem (Name of item)" command, or entering it yourself in the 'items' config. All items will be in Bukkit YAML Format.

    In the 'config' config, you will decide the chances of these items appearing in chests. The config will ideally appear something akin to this:

    Show Spoiler

    [​IMG]



    Future chests in this world will be populated with this items.

    (If possible), there would also be a 'populate' command that would populate all currently rendered chests with items from the config.

    Commands: /chestpopulator
    additem (Name of item)
    reload
    populate

    Permissions: None will be needed for this plugin. Permissions default to OP.

    When I'd like it by: Whenever possible! Thank you to anyone who picks this up! :D

    Additional Notes: This plugin must be compatible for 1.7.10!
     
  2. Offline

    DividedByZero

    This isn't likely practice because the plugin will have to scan the whole mine craft world. You would have to have the chest locations stored somewhere
     
  3. Offline

    I Al Istannen

    @DividedByZero
    Good idea, but you can make it extremly lightweight. Just populate the chest on the InventoryOpenEvent (maybe work, haven't tested) or the PlayerInteractEvent ;)
     
  4. Offline

    MinecraftBoxGut

    It would be the PlayerInteractEvent as the chest could be broken
     
  5. Offline

    Dark_Serpent

    I made a post yesterday in this thread but for some reason it won't show up for me. I'm going to assume it was possibly a forum glitch and summarize what I wrote, if it so happens it reappears I'll alter this message.

    I completely ran right over this problem, I guess I didn't think the request thoroughly enough. I was going off the general mindset of "When chests are rendered they'll immediately be supplied like a WorldGenerator", but I realize my fault in logic now (Since it won't actually be a WorldGenerator but a populator).

    Forgive me if I'm wrong, but if PlayerInteractEvent works like I assume it does, wouldn't the chests be populated on open every time, or perhaps chests placed down by players would be populated?

    Also, to summarize all the points and offer a suggestion, would it be possible if chests containing the items listed in the config (with the chances of the item actually appearing accounted for, as well as the number of items that could possibly be in a chest, with the chance of that being the max, i.e. "5 items in the chest at maximum, but only a 30% chance there are 5 items pulled from the config), could you define with a command, say:

    /chestpopulate populate (World) (Y Max)
    Via console

    /chestpopulate populate (Y Max) (Radius)
    Via in game

    And makes chests appear in that general area at random?

    To accomplish this, there would also have to be some sort of function to prevent a floor made of chests, and give each chest considerable space from the next (Perhaps best defined in the config), but it may be a solution since logging in every single chest in the World would be an arduous time consuming and significantly harder to code task.

    EDIT: I believe I'm forgetting something from my previous missing post, so I apologize if I said something odd / nonsensical.
     
Thread Status:
Not open for further replies.

Share This Page