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.
Got the random loot sorted now. I'm using Notepad with the 'show all characters' option enabled, makes its easier to spot the TAB's I'm so used to using in other programs.
hello !
Somes settings seem don't work for me :
Accept_poll false , i can pool as user preserve_slots: true, i can move item into chest and keep this new position enabled :false , i can open it as user too
Seem if 2 players open the chest in same time they can grab 2 differents random loot at the same moment.
I forget something ? Ty
@dumptruckman
Thanks Dumptruck, I'l have another look now...and I was so sure I had no tabs!
@Ethrock
If you used the tool I linked you, it would tell you exactly where to look... http://pastie.org/4559540 on line 65 and 66, the preceding indentation is tabs. You can tell by using your mouse to highlight the space. As you will see, instead of highlighting one space at a time it highlights only nothing or the entire indentation at once. This happens because those are tabs, not spaces.
@markdf
The same goes for you.... Except you have more issues with your file. Please paste your yaml file onto http://yaml-online-parser.appspot.com/ and it will tell you which lines have issues. You have quite a number of tabs which are NOT allowed in yaml files. That website will help you identify where. Also, your indentation is not consistent. Any time you have a "heading" such as porkchop: where there is no value on the same line, the lines underneath need to be indented the same amount as all other indentation. So if your general indentation is 2 spaces, it needs to be 2 spaces all around.
@Urwy
This is NOT a craftbukkit check I am using. It is part of the Bukkit api. I do not build ChestRestock with CraftBukkit in mind. Only Bukkit. Tell the Tekkit developers that they need to implement a simple aspect of the Bukkit api.
@dumptruckman
All the indents were done with spacing, not tabs. Should I have no indents? The demo file does have indents as I recall.
DumpTruckMan:
That is most likely the issue as I'm running a Tekkit server. Towny solved this issue by adding a part in the config that bypasses the CraftBukkit check.
If you could please add proper Tekkit support, I'd love ya forever.
So I have set up an adventure world and set up a few chests to restock for loot. On startup however it says "[WARNING] [ChestRestock] The world 'Adventure' is not loaded!" Which is true because multiverse has not loaded the world yet. Do you think it would be possible to have this plugin enable after things like multiverse? I haven't noticed any errors with the chests yet, so for now it is just console spam.
Still trying to get the random loot file to work for me. This is global_defaults.yml http://pastebin.com/eMwCypGX
In the loot_tables folder in file mark.yml http://pastebin.com/7sRPyPRD
any help would be appreciated.
@PuneyWhiteBoy
Use the ID
Do you set the item with the id or the name?
I'm actually in the process of setting up all the chests again, I'll let you know how I go. Because chests in a worldguard protectected area, I also have to make an allowance within the worldguard region else the chests (not just restock chests) cant be opened.
Thanks for the reply.
@Ethrock
Yaml does not like tabs and you have tabs in yours. Use this to see where http://yaml-online-parser.appspot.com/
@bloobubba
The plugin works fine for me. If it stopped restocking, either a. it's not set to restock, b. someone used /cr update on it when it was empty, c. the restock period is really long, d. you are past the player limit and do not have permission to loot unlimited.
@penguinbait
I'll see about adding this in the next version.
@diannetea
Yes, read about what was added in V2.3-SNAPSHOT-b63 http://dev.bukkit.org/server-mods/chestrestock/files/17-2-3/
@BenjamiinNoR
It will when the Bukkit API supports it.
@Mayhem777
yes.
@darkmyre
This is working as intended. For example, if you set up a chest with 1 dirt block in slot 3 and do /cr restock on the chest, it will add 1 to the stack and be at 2. But if the stack in slot 3 reaches the maximum (64) it will not be able to add more. Since you've set it to preserve slots it will not "spill over"
@PumasCast
I do understand that they are very complex, however, they are also very flexible with what is possible. If you can come up with a better way to offer essentially unlimited possibility for a random loot table, please share.
@markdf
My only explanation would be that someone went and used /cr update on the chest while it was empty.
@Urwy
Assuming this is the latest version of the plugin, the only way this would be possible is if you're trying to use a custom version of Bukkit that is not fully implemented. Sorry, this plugin is designed for Bukkit. Please contact the author of your Bukkit implementation regarding Bukkit.getWorldContainer(); return null.
@markdf
Show me the config file for that chest. Please use www.pastie.org for posting it.
@Urwy
I'll have to try an earlier version also. I had one chest that kept giving out enchanted swords without the restock time, yet checking all the chest cfg files didn't show the restock time being so fast. For now I just have the one chest setup, it gives free one stack of rail line per day in the shop to encourage rail cart building.
Come back dumptruckman! We need you!
@markdf
Exactly identical. I was able to get ChestRestock working on their servers by using the oldest version of ChestRestock available. While it's not the fix I was hoping for, it certainly solved the issue.
@Urwy
I assume your home server is identical to the hosts?
@markdf
Well the thing is the plugin works just fine on my home server. When I upload it to the server host's server that I'm renting that issue happens. I haven't even used chestrestock once on their servers. Just flat out doesn't work, which would suggest a hardware issue, but, my server host insists that it isn't a hardware issue.
@Urwy
I have no idea about the errors you are getting, but could you paste your cfg file for the plugin and a cfg file for one of the restock chests. Although as I said earlier, my restock chests dont all work any more, although they did. I'm not getting errors in the log though. We will probably just have to wait for dumptruck to sort out some issues out.
Reposting my issue...
When I run my server on my PC everything is perfectly fine, but, when I upload all the files over to a server that I'm renting I get all kinds of errors from ChestRestock. I contacted the admin of the server hosting site and he told me to ask for help here. Here is the pastebin link he gave me with the server log.
http://pastebin.com/cKkcK8kn
A lot of the restock chests are now not being restocked, looking at the cfg file and they items are not listed anymore.
@Urwy
Unknown Paste ID!