ChestRestock
This plugin allows admin to set up chests that automatically restock based on configurable parameters. This will allow you to create special chests for a variety of situations. You could create a chest for people new to your server containing a set of starter gear that they can only loot once. Or make reward chests in dungeons where you don't have to worry about them being empty. All kinds of things are possible!
Features:
- Automatically-restocking chests
- Chests can either add to or replace their current stock
- Configurable restock period
- Can either be set to start timing based on the time a player last opened the chest or at fixed intervals
- Can be set to preserve the position of the items in the chest
- Restocking chests are indestructible by default
- Limit # of times a player may loot each chest
- Restock chest by command
- Full multi-world support
- Chest naming
- Unique properties per chest (for any of the chest properties)
- Global default settings for all chests and optionally world specific defaults
- NEW in 2.0 Option for chests to have unique inventories per player (No loot theft!)
- NEW in 2.0 Option for chests to redstock when they receive redstone power
- NEW in 2.0 Commands are more dynamic
- NEW in 2.0 Now works with ANY block based inventory (dispensers, crafting benches, etc)
- NEW in 2.1 Option for chest to broadcast a global message when it restocks
- NEW in 2.2 Randomized loot for chests!
- NEW in 2.3 Command to restock all chests or chests with specific names and/or in specific worlds
- NEW in 2.3 Ability to set all chests in a world to restock with what is currently inside of them (This is limited by default to NOT include newly created chests!)
Instructions
- Place ChestRestock.jar in your plugins folder.
- Start your server.
- Type while in game for a list of commands
/cr
- Or target a chest and type This will set up the chest with default settings (adjustable in config.yml) and will restock with the items currently in the chest.
/cr create
Permissions
All permissions are default: OP
- chestrestock.*: grants all permissions
- chestrestock.cmd.*: grants all command permissions
- chestrestock.cmd.<cmdname>: grants specific command permission
- chestrestock.break.*: allows breaking any chest
- chestrestock.break.<chestname>: allows breaking specific chest
- chestrestock.bypass.lootlimit.*: allows unlimited looting of any chest
- chestrestock.bypass.lootlimit.<chestname>: allows unlimited looting of specific chest
- chestrestock.cmd.*: grants all command permissions
Further Help
- Type /cr help for a list of commands.
- Type /cr set while targeting a chest you have initialized with /cr create to see a list of properties you can set for it.
- Type /cr set <propertyname> to see a description of what the property does.
- Type /cr set <propertyname> <value> to set a value for a property.
- global_defaults.yml contains default chest settings for when a world does not have a specific default.
- defaults/<worldname>.yml contains default chest settings for specific worlds.
- If a default setting is missing for a world, the default in global_defaults.yml will be used.
- Loot Table Tutorial
IF YOU ARE HAVING LOOT TABLE PROBLEMS
First, go here: http://yaml-online-parser.appspot.com/
Paste your loot table file into the left-hand box. If it says you have problems in the right-hand box, this is why it doesn't work for ChestRestock.
Yaml is a very particular file format and it doesn't like when you don't enter things correctly. Read a tutorial.
@hawkfalcon
"/cr" shows you a list of all ChestRestock commands... "/cr create" turns the chest you are looking at into a restocking chest.
So /cr captures the contents of all chests in the world or just the one you are looking at?
the permission nodes dont work for players without Op permissions. im using groupmanager btw.
@MxRacer100 @xSokix @cosmoscraft @slixxkilla
Okay, in 2.3-SNAPSHOT-b20 I've added "/cr restockall [name] [-w:world]". With no additional arguments, it restocks every chest. You can also specify only chests with a certain name and/or only chests in a certain world. File to be approved shortly.
@Bradenb12
Hmm, www.pastebin.com the loot table file. Make sure you set the chest's loot table to the name of the file (without the .yml extension.) or if you put it in loot_tables.yml to the name of the loot table in there. Also, you may have to do "/cr reload" (but i doubt it).
@slixxkilla
Ive got it to work with the timed restock but i still need to find each chest in the hungergames map xD. Im restocking it each hour and making use of the hungerarena plugin for teleportation points.
@cosmoscraft
Funny i was thinking the same thing. Until this gets a restock all then its no go for me as well.
Please make an command to restock all chests in an world, it would be perfect for my hungergames event world.
@MxRacer100
I agree with including a /RESTOCKALL command. Its the reason I don't have it installed.
So i am trying to get a loot table working, and having issues.
I created the table, and put the .yml file into the loot tables folder. However I created the chests before that, and manuelly changed the llo table to that one. however whenever I restock, it wont use the table, it just uses the items it had in it.
Do you have any idea what I am doing wrong? Does the loot table in the cr set need to have the extension in it?
Can you plz plz plz add a command that restocks all of your chests without having the player to look at them, simply something like "/cr restockall" which would restock all of the chests and reset their timer. That would be awesome!
also it would be cool if i didnt have to reupdate all my chests for this to work, something like this doesnt need a config option, the players with permissions just have to decide themselves whether they want to type a universal command or not.
@dumptruckman
Permissions nodes in 2.2.1 and in 2.3 snapshot are being ignored, defaulting to ops instead.
Great news. :)
@generilisk
The latest ChestRestock snapshot is working flawlessly for me...
@BtBtDev
Enchants coming soon. :)
@generilisk
2.2.1 has a serious flaw in it. Every once and a while it will go nuts and potentially crash the server due to an infinite loop. What issues are you having with 2.3-SNAPSHOT-b9?
Also, just because it says it's searching for a ChestRestock chest doesn't mean it's because there's one configured. It searches to see if there IS a configured chest for certain events (such as redstone)
Unfortunately, permissions still aren't working for me. I'm using bukkit 2149, (1.2.5-R1.0) with 2.2.1, but I'm still having the issue with the 2.3 snapshot. I'm using PermissionsBukkit 1.6 for management, but it's still defaulting to ops
I don't know if this is related, but something is causing the plugin to search and try to restock chests that nobody has configured, and it crashes the server. I'll get a large number of errors along this line
but I'm not sure why it's deciding there are chests there, as only I (the op) can currently configure chests for restocking, and I haven't set one up at any of the locations it's trying. Is it checking every chest in existence?
OMFG WAIT! Randomized loot!!! This is perfect for my "General Store"
Also... is there a way to have random enchanted items?
Awesome update bro!
@CubieX
Thanks for noticing, will be fixed in next version. :)
@simplimazing
Make sure you're using the latest version and use the "/cr set redstone true" command.
How do u power the chest with redstone?
@dumptruckman: There is a false description in the config.yml
The second option says: "
But this is the time for restock. Not the max number of restocks per player.
And you should add as information that this also works with dispensers, which is really cool. :D