[WorldGuard Region Flag] AutoInventory

Discussion in 'Archived: Plugin Requests' started by Ted_Craft, Jul 12, 2014.

  1. Offline

    Ted_Craft

    WorldGuard Region Flag
    AutoInventory

    Plugin Category: Admin Tools​
    Suggested Name: WorldGuard AutoInventory Flag​

    What I Want
    Description, Commands, Permissions

    Description: This is a region flag for WorldGuard that allows an Administrator to set the inventory for a specific region in a world. When a player enters said region, their current inventory is saved and replaced with the region inventory. Then, upon exiting said region, the player's inventory is restored to what it was before the player entered the region. This would be useful for servers who want players to have a welcome book at spawn, but feel it isn't necessary in the rest of the world.​

    Item Properties: The items in an inventory, specified in inventories.yml, can be customized. The things on an item that can be changed: item type, damage value, name, lore, item amount, slot in inventory. Item type is the item ID, and damage value is the metadata of the item. Name is the item's name, and lore is the description of the item, both can include color codes. The amount is the number of said item in the inventory slot. The slot is where the item will appear in the inventory.​

    Commands:
    • /region flag <region> autoinventory <inventory> is used to set the inventory for <region>, where <inventory> is the name specified in inventories.yml.
    • /region flag <region> autoinventory reset is used to reset the inventory for <region> to default (empty).
    • /region flag <region> autoinventory survival is used to set the inventory for <region> to the player's survival inventory. (This is default for the world.)
    Permissions:
    • autoinventory.exempt prevents a player's inventory from being affected by region changes.
    • autoinventory.change allows a user to set a region inventory.
    • autoinventory.reset allows a user to reset the region inventory to default (empty).
    Example Config:
    Code:
    # WorldGuard AutoInventory Flag v<version>
    # Coded by <creator>, idea by Ted_Craft.
     
    inventories:
      spawn:
        compass:
          name: '&bTeleporter &7(Right-Click)'
          lore:
          - '&7Choose a destination to'
          - '&7teleport there.'
          item: compass
          slot: 1
          amount: 1
          damage: 0
        welcome-book:
          name: '&bWelcome!'
          lore:
          - '&7Server rules, ranks, and'
          - '&7information.'
          item: enchanted_book
          slot: 9
          amount: 1
          damage: 0
      store:
        compass:
          name: '&bTeleporter &7(Right-Click)'
          lore:
          - '&7Choose a destination to'
          - '&7teleport there.'
          item: compass
          slot: 1
          amount: 1
          damage: 0
        shop:
          name: '&aShop &7(Right-Click)'
          lore:
          - '&7Buy, sell, and trade items!'
          item: emerald
          slot: 2
          amount: 1
          damage: 0
    # All Properties
    #  <INVENTORY-NAME>:
    #    <ITEM-CODE-NAME>: #Doesn't affect the item ID, just used for coding.
    #      name: '<NAME>' #Can use '&' for color codes.
    #      lore:
    #      - '<LORE-LINE-1>' #Can use '&' for color codes.
    #      - '<LORE-LINE-2>'
    #      item: <ITEM-ID> #Item ID
    #      slot: <SLOT> #Slot the item is placed in, 1-9 starting in hotbar.
    #      amount: <AMOUNT> #How many of each item?
    #      damage: <DAMAGE> #What color wool, for example?
    
    Conclusion
    Thank you for reading!

    Thank you for reading this whole post, and thank you whoever decides to attempt making this custom flag. The config file is just a suggestion, do not feel bound by it. If you need me to clarify anything, just let me know in the comments. :)

    - Ted_Craft​
     

Share This Page