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.
I fi set player limit, is 1 time per day or only 1 forever? thanks!
Im getting a NPE when using /cr restockall or /cr restock
Using ChestRestock v2.3-SNAPSHOT-b49
tried on both: craftbukkit-1.2.5-R3.0 and craftbukkit-1.2.5-R1.0
error is: http://pastebin.com/G5rj6kZh
This definitely needs a solid tutorial!
Great plugin!
@sepukacheekray
@DumpTruckMan
Can make custom time chests? thanks!
As i discovered is using --> /cr set period [time]
But this plugin needs a better tutorial :)
Need more configs help please :D
player_loot_limit: -1 ??
preserve_slots: true??
etc...
Please, Please, Please add something where the redstone restocking is also unique, because i have a Maze, and i want the player to get the reward, then only be able to get it again if they redo the Maze, and i set the redstone thing to true for the pressure plates that open the original doors to restock the chest, but i dont want his friend to just chill outside restocking, so can you make it so you can enable unique redstone, or make it so when they take the items it teleports them or something
can't use lockette with this plugin please help!!! neither chestshop
anyone have some nice loot tables?
@disciple218
Similar problem here. CraftBukkit 1.2.5-R1.3 Beta & ChestRestock 2.3-SNAPSHOT-b49.
Chests work fine both without and with CR actually handling them. That NPE happens when a world is set with "auto_create:false" and a chest that is not handled with CR is opened by a player. The chest still works fine, but console gets this NPE. If the chest is handled by CR, or auto_create is set to true for the world, there is no NPE.
Funny that I've been using that for my hungergames map, to know when someone finds a chest I haven't yet found :P. Would be nice to get a console message when a chest is found/autocreated with the location where. Unless this is only temporary solution and the createall will eventually replace it. I don't think it's necessary then, since you can check the chests folder for all the chest places.
BTW, it sometimes fails to recognise a chest with "/cr create" if there is a vine, a torch or somesuch between you and the chest, even tho the chest has "the active grid displayed". Sometimes it does this too with you being a block higher than the chest (without anything between).
@Draganoth007
I get the same error!
Where is a tutorial or a wiki? I'm having trouble setting up a chest, it doesn't do the open animation and none of the players can loot it, it's just empty. I did /cr update, and it said it was updated.
@dumptruckman
http://bit.ly/IOEPFU
<<reply 701502="">>
This shouldn't have anything to do with ChestRestock... It could be a conflict with another plugin though. Are you using the latest build?
edit: give me the link that "/cr version -b" gives you.
Hey dumptruckman!
Love the plugin, really well made. Unfortunately when I install it into my plugins and run my server, after 10-20 minutes my console sends me:
net.minecraft.server.container.b<container.java:223> net.minecraft.server.container.clickitem<container.java:138> net.minecraft.server.container.b<container.java:223> net.minecraft.server.container.clickitem<container.java:138> net.minecraft.server.container.b<container.java:223> net.minecraft.server.container.clickitem<container.java:138>
Over and over again and my server crashes soon after.
This only ever happens when I have ChestRestock Installed. I would love to use this plugin but unfortately this happens all the time.
Do you know what the problem might be?
Thanks in advance,
James
<<reply 697839="">>
You can set auto_create via "/cr default -w:worldname auto_create true" and it will automatically make every block based inventory (that's not already configured with ChestRestock) opened in that world begin restocking with what's in it based on the defaults for the world (or global defaults).
<<reply 698932="">>
Also, there is already the "global_message" property of chests that triggers when the chest restocks... If the chest isn't set to "accept_poll" then this would only fire when someone opens the chest and causes it to restock. The message doesn't have any variables to fill in like time or player name however... Trying to work those in is turning out to be quite difficult with the plugin's design.
edit: The problem is there's so many chest properties that it becomes extremely difficult to actually come up with a time value at all due chest uniqueness, period_mode and probably other properties i'm forgetting.
<<reply 698932="">>
I think if you "/cr create" a unique chest with NOTHING in it, set the loot limit to 1 and then put a diamond in it and "/cr update" then it will restock when the player opens it with the 1 diamond (but the diamond won't be in there otherwise). That diamond won't persist through restarts so if they don't take it then it's their loss. But as long as they haven't looted it, it will always restock that one time for each player and be in there.
<<reply 698885="">>
I believe I have fixed this in the next version to release.
@dumptruckman
I see, so a nonunique chest will work normally with hawkeye. That is good. And if you can get a looting message/execute would be nice. Since I would have used hawkeye for checking if a user had looted the chest.
For example I have a temporary unique chest in my server that gives everyone one diamond (and doesn't restock). But I just have no way of knowing when everyone has taken their diamond and the chest becomes useless and can be removed.
[edit: After reading the new unique-help/text I see this is not the best option, since it doesn't persist. Will check other choices. Ideas how to distribute diamonds to all users fairly who might not be online atm would be appreciated :).]
Also I'm interested in this createall-command and will be waiting for it =).
And a simple thank you for the time you use for this plugin, it is appreciated.
NPE spamming my log: http://pastie.org/3888295
Chests seem to be working fine. I just upgraded to the latest snapshot for 2.3 and CB 1.2.5-R1.2.