Make items in your inventory go into config

Discussion in 'Plugin Development' started by immensebuttpain, May 20, 2015.

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

    immensebuttpain

    I need some help with my plugin: StarCache
    Currently you have to add items into the config, so it will make different crates fall. Well currently you have to add them into the config, how could i make it so you can just type a command i'll make "/starcache input" and it'll add all the items in your inventory as a new crate
    Config:
    Code:
    general:
    ##################################################
    # Time Between each Star Cache Event. #
    # Expressed in Seconds #
    ##################################################
    eventCooldown: 43200
    ##################################################
    # Radius is caclulated in a square #
    # Values will be +- the defined #
    ##################################################
    world:
    radius: 5000
    ##################################################
    # DO NOT TOUCH #
    ##################################################
    lastEvent: 0
    ##################################################
    # Are we using Factions to determine #
    # safe areas? #
    ##################################################
    useFactions: true
    ##################################################
    # How should we broadcast coordinates? #
    # By CHUNK or EXACT? #
    ##################################################
    announcer:
    method: CHUNK
    caches:
    netherstar:
    - 399%1
    blocks:
    - 57%32
    - 41%32
    - 42%32
    the end where it says "caches:" is where i want to add the command so i can input items into the starcache, i've never worked with something like this in a plugin so some help would be nice!
    If someone is confused on what i mean just message me and i'll try to explain better
     
  2. Offline

    meguy26

    @immensebuttpain
    Get the inventory contents, loop through them and create a new crate...
     
Thread Status:
Not open for further replies.

Share This Page