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.
is there a way to restock all chest at once?
@dumptruckman
could the loot_table file can add lore to item?
@gamma1511
he provides an explanation on what to do when your table doesnt work in the main post. do that instead of spamming the comments with wrong-format stuff.
why doses my loot table don't work
test: '1': chance: 0.1 id: 280 amount: 1 '2': chance: 0.3 id: 268 amount: 1 '2': chance: 0.2 id: 272 amount: 1 '2': chance: 0.1 id: 267 amount: 1 '2': chance: 0.01 id: 283 amount: 1 '2': chance: 0.03 id: 276 amount: 1 '2': chance: 0.01 id: 319 amount: 1 '2': chance: 0.01 id: 320 amount: 1 '2': chance: 0.01 id: 349 amount: 1 '2': chance: 0.01 id: 350 amount: 1 '2': chance: 0.01 id: 357 amount: 1 '2': chance: 0.01 id: 360 amount: 1 '2': chance: 0.01 id: 363 amount: 1 '2': chance: 0.01 id: 364 amount: 1 '2': chance: 0.01 id: 365 amount: 1 '2': chance: 0.01 id: 366 amount: 1 '2': chance: 0.01 id: 367 amount: 1 '2': chance: 0.01 id: 375 amount: 1 '2': chance: 0.01 id: 391 amount: 1 '2': chance: 0.01 id: 392 amount: 1 '2': chance: 0.01 id: 393 amount: 1 '2': chance: 0.01 id: 394 amount: 1 '2': chance: 0.01 id: 400 amount: 1 '2': chance: 0.01 id: 297 amount: 1 '2': chance: 0.01 id: 282 amount: 1 '2': chance: 0.01 id: 160 amount: 1 '2': chance: 0.01 id: 261 amount: 1 '2': chance: 0.1 id: 262 amount: 1 '2': chance: 0.05 id: 288 amount: 1 '2': chance: 0.05 id: 318 amount: 1 '2': chance: 0.01 id: 116 amount: 1 '2': chance: 0.3 id: 346 amount: 1 '2': chance: 0.01 id: 358 amount: 1 '2': chance: 0.05 id: 338 amount: 1
@dumptruckman
Hi, you're alive, thats great. When I use this plugin, restocking works just fine in chests and trapped chests. But when it comes to dispensers, droppers and hoppers, as well as furnaces and brewing stands, it doesnt work anymore. Which means. I can open the block normally as long as it doesnt have a loot table. I can put items and use /cr create. But if I right click it then, instead of opening the block's gui, it just randomizes a part of my inventory and puts the items in the armor slots and the small crafting grid. Could you fix this maybe? Also would it be possible to do the auto-create thing "per block type" ? So essentially I can set an auto create table for hoppers, for chests, for double chests, for trapped chests, double trapped chests, dispensers and so on? (I need this because for example the brewery city is so damn huge and theres tons of brewing stands and it would takes ages to set all them manually, but my auto create urban loot table is used for lots of other map areas already and for whats yet to come, basically all urban loot, and so this would be really helpful... thank you in advance!
Hello first of all I would like to say this plugin really helps my server, and I enjoy it very much. However when I try to put a written book in the chest (my server has a small amount of dungeon quest in it) and after I type /cr set period # or /cr create it reverts the book to "Written Book" and whenever I open it it says *Error* in the book.
I am not sure what the problem is but I would like an answer to the solution, thanks!
Hey i am an owner of a gta server i need a plugin that restocks all the chests in the world for and can have percentages for a item! Please Give Me A Link For A Plugin Or update this one please!
Got it working, and i even added a config option, would you like to to submit a... I think they are called push requests? so that my code can be added the the github? Not sure how to make a push request, cause I don't have permission to just straight up push.
@dumptruckman
Thanks, I am on my way now. Found out how to use maven... lol this thing can get confusing. Currently figuring out how to compare the inventory type, to a chest and what not. Edit 1: Got my thing to compile, now i am going to bed... gunna test in the morning.
@Adondriel
Just type
in the project root directory. The jar will appear in a directory called target.
@Adondriel
So I made the changes, now how do I compile this so that I can test it?
@dumptruckman
yea, so that furnaces and anything other than chests are not included. Currently, my map has like 10 furnaces in each house, and I don't want users to be able to loot those. I use skript, to then cancel the rightclick event on furnaces but it is cause a large amount of inventory glitches.
Edit 1:Maven is seriously a pain in the ass to setup... I have no clue what i'm doing with maven, and now one of the files is missing for some reason Edit 2: Nvm, it magically showed up again... Edit 3: Why does it never find the correct dependencies?
@Adondriel
Interesting.. What do you mean exactly? Making it so you cannot enable restocking on furnaces?
@ChunkieMiner
The solution to your issue, is to experiment.
I'm working on making an option for disabling furnaces and things other than chests. Currently trying to setup my eclipse environment.
@KreatorB
well, for me it still does work perfectly fine, except for a small modification one of our coders did that fucked up loot in dispensers and stuff ... and thiiings
HOW CAN I MAKE IT SO THAT ANYONE CAN OPEN THE CHEST?? WHAT PERM
@Shado47
I agree, workign nicely and all options to use chest restock to make PVP/Hunger Games world this is it. Thank you
On 1.8.1 CraftBukkit Server with latest March update.... seems to be working
SPOKE TOO SOON: my config file has a trouble when I change names of the loottable name in the loot_table file and I created my own loot table and it can not locate the file.... ;-(
Works perfectly well on 1.8 Spigot. Good Job man! And lets keep in mind how much Mojang fked up with 1.8 (and this is a 1.6.2 release, not even 1.7) ... this plugin is really good. Thanks dude, you are awesome for creating this ^^