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.
@dumptruckman
So how would we use the auto_create? and would it apply to all the existing chests in a map?
<<reply 697631="">>
I'm working on adding a /cr createall. It's pretty damn complicated though. It'll be in the 2.3 release. For the time being in b48 there's an auto_create option settable per world... Only problem is this would affect any new chests added as well. Though if you use the right settings, it wouldn't be noticeable.
Also, Multiverse-Adventure can completely reset maps.
@cosmoscraft
Yeah, kinda sucks that, would be nice if the creator of the plugin made a /cr createall command that just creates all the chests that is on the map, even if it took a long time to do the first time it would be worth it, either that or wait until HungerArena add the feature that restocks the chests automatically when somebody wins the game
Perfect :)
@raom
I discovered a bug with unique mode chests that may have been causing your issue with items disappearing.
Unique mode also is why hawkeye can't track it. I'm not sure I can fix this and I don't really see the point either considering unique means every player has a unique version of the inventory which prevents theft.
Player loot limit is how many times the chest will restock for the player, nothing more, nothing less. Perhaps a misnomer though. ;p
@jayD101
@raom
As for a loot message, I'm looking into what I can do.
Just want to say this plugin is awesome and I want to see it become more popular! Kudos dumptruckman :)
could you add message configuration when a player open a chest ?
(with triggers like %playername %timeleft ...) so we can warn players that the chest is restockable, when, etc ...
is that doable ?
thx, great plugins, btw :)
Nice plugin. Fiddled with it a bit and it seems to work ok.
There was a time when I tried to set a chest with period to "-1" to disable it, and when rebooted the chest was empty (there might have been a creative remove&replace for the chest, but the contents were still there before reboot). But when I created the chest again and set the period to "0" it worked with rebooting fine. So I guess "-1" was a bad choise?
Other settings were :
restock_mode: replace
accept_poll: false
redstone: false
player_loot_limit: 0
period_mode: player
unique: true
ChestRestock Version: 2.3-SNAPSHOT-b23
Bukkit Version: git-Bukkit-1.2.5-R1.3-b2175jnks (MC: 1.2.5)
If I may, I'd like to ask an option to add either a broadcast, or a command to be run when a player opens a chest. To have some sort of TreasureHunt thing, where everyone knows who found the chest, or the admins know when to change the chest's place.
Oh yeah. Seems that Hawkeye doesn't know anything about the transaction or even opening the chests that are "created". Is this something that can be altered, or not? Could there be some sort of compliance either with Hawkeye or Guardian when they get it working?
And one more :). Is the "player_loot_limit" actually a 'how many times the chest restocks', and not 'how many times a player can loot it'? So setting 1, will restock it once, so the player can loot it twice?
Humm looks awesome! Ima try this, we could definally use this for some treaure hunts, and other events, awesome ima, ill give feedback after i put it to use. !
@QuinnFaye
Bug in an old version. Use latest.
The plugin is messing up my server and casuing errors, here is what the server host says: When your server crashes I'm seeing thousands of errors being repeated over and over. You will want to contact the author about that plugin (it looks like ChestRestock) or remove it.
.... 2012-04-27 18:53:47 [WARNING] [ChestRestock] The world 'Apocalypse' is not loaded! 2012-04-27 18:53:47 [WARNING] [ChestRestock] The world 'Apocalypse' is not loaded! 2012-04-27 18:53:47 [WARNING] [ChestRestock] The world 'Apocalypse' is not loaded! 2012-04-27 18:53:47 [WARNING] Task of 'ChestRestock' generated an exception .... (errors begin and repeat) at com.dumptruckman.chestrestock.DefaultCRChest.<init>(DefaultCRChest.java:42) at com.dumptruckman.chestrestock.DefaultChestManager.loadChest(DefaultChestManager.java:162) at com.dumptruckman.chestrestock.DefaultChestManager.initPolling(DefaultChestManager.java:67) at com.dumptruckman.chestrestock.DefaultChestManager.<init>(DefaultChestManager.java:42) at com.dumptruckman.chestrestock.ChestRestockPlugin.getChestManager(ChestRestockPlugin.java:93) at com.dumptruckman.chestrestock.DefaultCRChest.<init>(DefaultCRChest.java:42) at com.dumptruckman.chestrestock.DefaultChestManager.loadChest(DefaultChestManager.java:162) at com.dumptruckman.chestrestock.DefaultChestManager.initPolling(DefaultChestManager.java:67) at com.dumptruckman.chestrestock.DefaultChestManager.<init>(DefaultChestManager.java:42) at com.dumptruckman.chestrestock.ChestRestockPlugin.getChestManager(ChestRestockPlugin.java:93) at com.dumptruckman.chestrestock.DefaultCRChest.<init>(DefaultCRChest.java:42) at com.dumptruckman.chestrestock.DefaultChestManager.loadChest(DefaultChestManager.java:162) at com.dumptruckman.chestrestock.DefaultChestManager.initPolling(DefaultChestManager.java:67) at com.dumptruckman.chestrestock.DefaultChestManager.<init>(DefaultChestManager.java:42) at com.dumptruckman.chestrestock.ChestRestockPlugin.getChestManager(ChestRestockPlugin.java:93) at com.dumptruckman.chestrestock.DefaultCRChest.<init>(DefaultCRChest.java:42) at com.dumptruckman.chestrestock.DefaultChestManager.loadChest(DefaultChestManager.java:162) at com.dumptruckman.chestrestock.DefaultChestManager.initPolling(DefaultChestManager.java:67) at com.dumptruckman.chestrestock.DefaultChestManager.<init>(DefaultChestManager.java:42) at com.dumptruckman.chestrestock.ChestRestockPlugin.getChestManager(ChestRestockPlugin.java:93) at com.dumptruckman.chestrestock.DefaultCRChest.<init>(DefaultCRChest.java:42) at com.dumptruckman.chestrestock.DefaultChestManager.loadChest(DefaultChestManager.java:162) at com.dumptruckman.chestrestock.DefaultChestManager.initPolling(DefaultChestManager.java:67) at com.dumptruckman.chestrestock.DefaultChestManager.<init>(DefaultChestManager.java:42) at com.dumptruckman.chestrestock.ChestRestockPlugin.getChestManager(ChestRestockPlugin.java:93) at com.dumptruckman.chestrestock.DefaultCRChest.<init>(DefaultCRChest.java:42) at com.dumptruckman.chestrestock.DefaultChestManager.loadChest(DefaultChestManager.java:162) at com.dumptruckman.chestrestock.DefaultChestManager.initPolling(DefaultChestManager.java:67) at com.dumptruckman.chestrestock.DefaultChestManager.<init>(DefaultChestManager.java:42) at com.dumptruckman.chestrestock.ChestRestockPlugin.getChestManager(ChestRestockPlugin.java:93) at com.dumptruckman.chestrestock.DefaultCRChest.<init>(DefaultCRChest.java:42) at com.dumptruckman.chestrestock.DefaultChestManager.loadChest(DefaultChestManager.java:162) at com.dumptruckman.chestrestock.DefaultChestManager.initPolling(DefaultChestManager.java:67) at com.dumptruckman.chestrestock.DefaultChestManager.<init>(DefaultChestManager.java:42) at com.dumptruckman.chestrestock.ChestRestockPlugin.getChestManager(ChestRestockPlugin.java:93) ..... (many more)
@dumptruckman
Thanks, your Awesome
@cosmoscraft
Ok, I realized something I was using was causing all default OP permissions to also require OP status. This was a mistake. Thanks for pointing it out. Build 23 will be approved soon but if you want it now: http://ci.onarandombox.com/job/ChestRestock/23/
@dumptruckman
i was talking about the hidden chest in the hungergames map, you have to manually find them and /cr create. Also the permission nodes dont seem to work for my admins who dont have OP permission.
@cosmoscraft
In the last update I added /cr restockall. You don't have to find them all ;p
@hawkfalcon
This seems like an unlikely feature for me to add... Considering each chest has it's own set of properties and all, is this really something you'd need? If any of the chests were not suppose to be like default, you'd have to go configure them one by one anyway. Also, what if you did it accidently to some chest you didn't know about.
@cosmoscraft
Already done :)
@miguemely
yeah but you still need to find all those chests.
Will this plugin work like for example,a hunger games server? So example it captures the chest and contents,then when i want to restock it it restocks with the SAME exact thing?
@dumptruckman:
The permission nodes dont seem to work with groupmanager. I want my Admins without OP being able to use the commands.
Ohh. Is a /cr all command possible? maybe all chests within the chunk?