Suggested by: al3x74 Installation: Unzip the .zip archive with winRAR or 7-Zip and drop all the files (two ) in the 'plugin' folder.How to use/Features:RandomChest generates a chest-field between to points:You can control the chest number and the size of the field.In the chests are random* items, so the Hungergames feeling is very well *Not really 'random', you can customize the items in the config file like that: Code: wood_sword: min: 0 max: 1 probability: 2/7 The '2/7' represent a mathematical break. You can use all natural breaks you want The 'min' value is the min amount of the appearing items.The 'max' value is the max amount of the appearing items.You can make the chest auto-refilling or auto-regenerating after a certain time (example: 1 week, 2 hours... 1 second )Download the latest version now! Commands: /rc autorefill [Field-Name] [time/delete] [ms,s,m,h,d,w] - Let the Field auto-refill after a time or delete the auto-refilling (ms = milliseconds, s = seconds, h = hours, d = days, w = weeks)/rc autoregenerate [Field-Name] [time/delete] [ms,s,m,h,d,w] - Let the Field auto-regenerate after a time or delete the auto-regenerating/rc addmanully/addmanu [Field-Name] - Add a special Chest to the field, this chest won't be regenerated but it gets refilled when the other Chests get refilled./rc removemanually/removemanu [Field-Name] - Remove a special Chest from the field (Only the Chests that you selected with /rc addmanully/addmanu)/rc remove [Field-Name] - Remove a Chest-Field forever./rc generate [Field-Name] [max x] [max z] [chest number] (chestrefill-type)- Generate a Chest-Field between your x and z coords and the coords you type in.The Chest Number represents the Chest-Number in the field. The chestrefill-type is the item-config used for this field**./rc regenerate [Field-Name] (chestrefill-type) (chest number)- Regenerate a Chest-Field./rc refill [Field-Name] (chestrefill-type) - Refill all chests in a Chest-Field. (With the specified chestrefill-type)/rc reload - Reload the Config-FileLegend: (Can use) [Must use]Permissions: RandomChest.rc - States whether a player can use all commands NOTE: I've made only one Permission, because if you can generate fields you have to have the permissions to delete them. **Configuration: Code: chestconfig: types: default: wood_sword: min: 0 max: 1 probability: 2/7 stone_sword: min: 0 max: 1 probability: 2/20 exampletype: bedrock: min: 5 max: 64 probability: 1/1 config: console-signals-by-regenerate: true console-signals-by-refill: true console-signals-by-regenerate - if this is 'true' the plugin will send a message to the console if a field got auto-regenerated console-signals-by-refill- if this is 'true' the plugin will send a message to the console if a field got auto-refilledchestconfig - configure out the items types - the types that you can use in the commands (chestrefill-types) (example: type: hungergames - make them yourself)wood_sword - scroll up to features Changelog Download V1.0V1.0 - Release Download V1.0 FIX!!!!V1.0(.1) - Fixed the '1 hour = 6 minutes' bug To-do-List Message to the console if a chest gets opened (configurable) signal-configuration for single fields Known Bugs: None I'm free for suggestions Hope you enjoy!
Important: I've found a little mistake in my plugin: 1 hour would be 6 Minutes Please download the new version with the fix: here
Ok, here it is: (For all those want to see the code lines,too ) Code: Random r = new Random(); int min,max; min = getConfig().getInt("chestconfig.types." + chesttype + ".items." + item + ".min"); max = getConfig().getInt("chestconfig.types." + chesttype + ".items." + item + ".max"); int number = r.nextInt((max + 1) - min) + min; ItemStack stack = new ItemStack(Material.valueOf(item.toUpperCase()), number); String[] raw = getConfig().getString("chestconfig.types." + chesttype + ".items." + item + ".probability").split("/"); int break1,break2; break1 = Integer.valueOf(raw[0]); break2 = Integer.valueOf(raw[1]); int appear = r.nextInt(break2 - 1); if(appear <= (break1 - 1)) { if(number!= 0) { inv.addItem(stack); } }
oh can i put it on chinese bbs? i think it is a good plugin. i can use it to make a game :> .i have found it for a long time QAQ l am moved my english is pour Ow kay ,thanks
Sorry, but I don't know the chinese bbs, so can you please tell me what that is, so I can answer the question?