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.
@sammyturbo123
If the chest property "unique" is set to "true" then that is probably why you are experiencing this. The unique property creates virtual inventories per person and they are not persisted through restarts. I may look at changing this is future versions though.
@ValeraSTK
Not currently. You can make the chests indestructible though. I could look at options for allowing this in the future.
@ValeraSTK
This is very similar to the previous answer. I will look at adding some way to get around this problem in the future.
@drgdirgu
1. You can type "/cr restock" while targeting a chest to simply restock that one chest. "/cr restockall" can potentially cause a lot of lag depending on how many restocking chests you have and more specifically if they have any loot tables assigned to them. 2. You have the chest set to "unique" and must have a loot limit set for players (where you have a bypass) that is causing it to not restock for them. You'll have to change one of those settings.
@DeadlyN00b
I could consider this for future versions.
Hi, is it possible to make chests temporarily disappear or de-spawn when they are empty?
@sammyturbo123
I have the same problem... AND: I have to type "/cr restockall" several times for all the chests to refill... and that's not the only problem. When I do, and I can finally see the content of any chest, other players can't. That's a big problem... entering 6 to 12 times /cr restockall is not a big deal... but if the other players can't see the items I clearly see in the chest...
Either way, thanks dumptruckman for your work =)
@sammyturbo123
I use some region tool, which can load WE schem files via console. So, in this regions, I need chests manageg with CR. So those chests not in place 100% of time, but when its there, I need it to be managed by CR.
So, all I really need is keep my chest cfg files even when chest not in place. Is it possible?
@ValeraSTK
Why would u want to break it anyway?
Hi! If I break the chest manually, and place it again - its not managed by CR anymore. Can I somehow change this?
PROBLEM: make a chest with items in it. then once i stop the server and start it back. the chest has no items in it!!
@EnchantedBishop
Yes. Already supports colored item names/lore/etc in the latest beta available however they are not yet supported in loot tables. And yes. I am slowly working on an update. The update will make creating loot tables easier and allow them to support item meta.
@Plutonium64x
Use the
command.
@Infiniboom
I'm not sure I understand the problem you're having.
@Talidorn
This is true for if you set them up manually or have auto create enabled for a world. I'll have to see what I can do for future releases.
@monstercat101
Defaults only apply to newly created CR chests. Ones already set up with the plugin will not update with any changes to the defaults. I may be able to add a setting that will tell chests to update their settings when the defaults change in a future release.
@selkiegal
Use the latest beta.
@sfkwww
Not sure this is possible yet. The upcoming version will allow all sorts of item meta however.
@Helionixdesti
No. I am working on a solution for this however it will not support in game editing. Instead I am creating an external GUI that can be used to design loot tables with ease.
@Go4Nightfire
Not possible yet. Thanks for the suggestion. I'll see what I can do for future release.
@thirtyvirus
Use latest beta. It is very stable.
@x12rounds
Good idea. I'll see what I can do for future release.
@charlza
Yes, it is based on location. I don't think there's any other option. This means that it would not work with something that moves blocks around.
Whoops- I got my plugins mixed up....I haven't installed this yet, until I can get an answer to the question I posed a couple days ago.
Is ChestRestock based on the chests location? The reason I'm asking is that I have another plugin- Ships- that moves a collection of blocks like a boat or airship. If the chests location changes, does it lose the ability to restock? Thanks!
Permission so players can open them? I have world guard and the chest-access flag works accept for on these chests.
Please fix fireworks with this plugin; they immediately lose all of their attributes when you place them in the container :(
This is exactly what I was looking for, thanks for making it. I will definitely be using it. :)
@dumptruckman
Thanks for this awesome Plugin. I only got a question for you is there a way to stop the chest restocking if there is a player nearby a given radius. On my server people literally camp near the chests and wait for it to restock. If I could make it so that there is a time limit but if someone is in the given radius it waits as long as there are people in the radius?
Thanks a lot, Nightfire
Is it possible to set a chest with a loot table in game ? something like /cr create tablename ?
How do you enter enchanted golden apples in the loot table?
Hey there, little bug I've discovered. Any fireworks in chests set to restock will become default rockets that don't do anything (they lose all attributes). Kind of a bummer with July 4 coming up, I wanted to set up freebie firework chests for players that day.
I set the world to have unique chests disabled, yet I am still getting unique chests per player o.o How do I fix this ? I've spent a while trying to get it working.
Is there a fix/workaround for furnaces? Using this plugin causes furnaces (e.g. at blacksmiths) to get "claimed" by the plugin. They cannot then be destroyed by players. If you need additional info let me know.
Hey I've created a randomization loot table for Chest restock based on vanilla loot tables. Can some of you review and tell me if there are any corrections needed?
http://pastebin.com/ZBeHWppb
Thanks - Tali