Chest Randomization

The Chest Randomization Feature is one of the more powerful and interesting features provided by the plugin. It can be customized. To customize it, open the plugin .jar file and extract survivalchests.cfg and place it in the \plugins\BCRandomizer file of your bukkit installation. Make the requisite changes in the file as desired. Optionally, you can create a new file, from scratch, that follows the appropriate format. It's usually just easier to edit the default configuration.

Randomization Customization:

The configuration is relatively simple, consisting mostly of lines of comma-delimited values indicating each item. Here is one such line from the default configuration:

!Diamond %CLEVERSWORDNAME%,2,276,0,0.1,0.9,1,1,,NONE,900,SHARPNESS,100,FIREASPECT,50,KNOCKBACK,100

Name,Weight,ItemID,Data,LowDurability,HighDurability,MinStack,MaxStack,Lore,EnchantmentName, EnchantmentProbability...

The first part indicates the name of this item. The exclamation mark tells the plugin that the generated item should share the name given. %CLEVERSWORDNAME% uses a random name generator to create a name for this sword; some examples of this case could be "Katana of Brisk Sneezing" or "Blade of Extreme Selling". Implemented "clever" names include:

%CLEVERAXENAME%
%CLEVERBOOKNAME%
%CLEVERHOENAME%
%CLEVERSHOVELNAME%
%CLEVERSHEARSNAME%
%CLEVERSIGNNAME%
%CLEVERHATNAME%
%CLEVERCHESTPLATENAME%
%CLEVERLEGGINGSNAME%
%CLEVERBOOTSNAME%
%CLEVERSWORDNAME%
%CLEVERBOWNAME%

The second entry is the probability weight of this item. The plugin adds up the weights of all the items in the file, and the percentage that this value is of that total is the percentage chance that this item will be created when the plugin wants to generate an item. In this case, the item is very rare and will not generate very often, because most entries in the default file are 20's, 50's, and 100's. The ItemID is the... well, ItemID, of the item. the Diamond Sword is ItemID 276, so that is what is put here. Next comes the Data value of the item. For items such as Dyes (which you might want to use for some reason, I'm not going to judge you) this item will determine some qualities. Most items don't use it, but if you happen to want to create an item that does, this is available. The next item is the minimum durability, followed by the maximum durability. the generator will select a value between the given percentages of the created items total MaxDurability and give the created item the resulting value. In this case, the item generated will have a durability above 10% but no more than 90% when inserted into a chest or other inventory. The next two items are the minimum and maximum stack sizes for the generated Item Stack. This has 1 for both, meaning you won't get stacks of diamond swords, which is probably for the best. Next, the blank item is the optional "lore" for the item. This has some special rules; you can indicate a Lore to use here directly. However, if the item name has "of" in the title, (which most of  the built-in "clever" name generators will insert) than there is a chance the plugin will give the item a random lore value itself; there is also a small chance of any generated tool (Axe, Pickaxe, Sword, Hoe, Shears, and Shovel) of being given a random Lore as well.

The items after this are Enchantments followed by their probability weighting. Valid Enchantment names the plugin recognizes as of Plugin Version 2.0 are NONE, FLAME, POWER, INFINITY, PUNCH, SHARPNESS,ARTHROPODS,SMITE,EFFICIENCY,UNBREAKING,FIREASPECT,KNOCKBACK,FORTUNE,LOOTING,RESPIRATION,PROTECTION,BLASTPROTECTION,FEATHERFALLING,FIREPROTECTION,PROJECTILEPROTECTION,SILKTOUCH,AQUAAFFINITY, and THORNS. A enchantment name can be prefixed with a exclamation mark; if this is done then the item will be forcibly given that enchantment with the level that will be used in lieu of a probability weighting.

POTIONS:

Potions are another item that can be generated. The Syntax is similar to the standard Item line, but changes the meanings of some of the entries. All Potion lines start with POTION:

POTION:NAME,PROBABILITY,ID,<unused>,Duration,Level,Splash

The first is, self evidently, the name of the potion. Valid Potion names as of Plugin version 2.0 are BLINDNESS,CONFUSION,RESISTANCE,HASTE,FIRERESIST,DAMAGE,HEAL,HUNGER,STRENGTH,INVISIBILITY,JUMP,NIGHTVISION,POISON,REGENERATION,SLOWNESS,SPEED,RESPIRATION, and WITHER.

The second is the standard Probability; this is used the same as the aforementioned probability for other items. Next is the ID. This will always be 373. Current implementations force all Potions to use Item ID 373, but you can never know how the future will hold so it's best to be explicit and specify 373 in your configurations. The next item is unused. Duration is the length of the potion effect, if applicable, in seconds. The next two are the level of the potion effect and whether the potion is a splash potion.

One thing notable with potions is that the plugin will randomly add up to 4 additional effects to any potion, which could be any of the valid effects. This can create negative potions (like poison) that have powerful positive effects (regeneration, speed, jump, etc) as well as positive potions that have negative effects. This feature was added to make the game more hectic and attempt to level the playing field by making it more difficult to quickly decide which items to take and which ones to leave.

Items can have special "prefixes" added to them. Prefixes are when the line starts with a prefix and a colon. valid prefixes include STATIC:, SUPERENCHANT: and SINGLEENCHANT:

STATIC: has a special effect; instead of chest population choosing items when it populates all the chests, static items instead choose a random chest to be placed into after the main population run. This means that items prefixed with STATIC: will always be present in a chest somewhere, but will only ever appear once. SUPERENCHANT cranks up the enchantment counts and probabilities for the enchantment selection logic, which usually results in more enchantments as well as more powerful enchantments. SINGLEENCHANT: will only allow one enchantment to be applied Total.

Repopulation:

Chest repopulation:

one of the features I have added with the release for Bukkit 1.5 include a feature to repopulate chests:

- when the game starts, all chests are repopulated as usual.
-when a player closes a chest or other inventory and a configurable delay elapses, that chest will be repopulated.
- if another player opens the chest, the timeout will be cancelled. When the player closes it again a new one is created.

the desired effect is that only chests accessed by players will timeout, but not if somebody else accesses it in the meantime. This timeout value can be changed before starting a game using /repoptimeout. setting it to 0 will disable repopulation, any other value is interpreted as the number of seconds before an attempt to repopulate is made.


Comments

Posts Quoted:
Reply
Clear All Quotes