New Feature: Chest Support Added
Key Features:
- Flexible Loot Customization: Tailor chest loot settings with precision, specifying the items, percentages, and amounts.
- Tiered Loot Distribution: Items are distributed into tiers, adding variety and complexity to the loot. Each tier has its own set of items with different probabilities.
- Biome-Specific Chests: Customize chest loot for specific biomes, allowing for a more immersive and thematic distribution of items based on the environment.
- Easy Configuration: Edit the ChestSettings.yml file located in the SkygridBlocks folder to define the loot settings for each chest. Use compact or expanded formatting for easy customization.
How to Use:
- Update your plugin to the latest version.
- Configure Chests: Open the ChestSettings.yml file located in the plugin's SkygridBlocks folder.
- Customize Loot Settings: Define the loot settings for each chest in the configuration file. Use the provided examples as a guide.
Code (YAML):
# The available items for use can be found at https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
# The available biomes can be found here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/Biome.html
# In YAML, identifiers or keys (such as "Chest1" in your example) are subject to certain rules.
# - Do's -
# Alphanumeric Characters: Identifiers can contain letters (both uppercase and lowercase) and numbers. For example, "Chest1" is a valid identifier.
# Underscores: You can use underscores (_) in identifiers. For instance, "my_chest" is a valid identifier.
# Hyphens in Quoted Strings: If an identifier contains special characters or spaces, you can enclose it in single or double quotes. For example, "'Special Chest'" or "\"Special Chest\"" are valid.
# - Don'ts -
# Special Characters: Avoid using special characters like !, @, #, $, %, etc., in identifiers without enclosing them in quotes. For example, "Chest@123" should be written as "'Chest@123'" if you want to use special characters.
# Leading Spaces: Identifiers should not have leading spaces. For instance, " MyChest" with a space at the beginning is not a valid identifier.
# Trailing Spaces: Similarly, identifiers should not have trailing spaces. "MyChest " with a space at the end is not valid.
# Spaces in the Middle: While you can use spaces within identifiers if they are enclosed in quotes, it's generally a good practice to avoid spaces within identifiers for clarity. For example, "My Chest" is valid, but "MyChest" is more commonly used.
# Reserved Keywords: Avoid using YAML reserved keywords as identifiers. These keywords have special meaning in YAML and should not be used as keys. For example, "true," "false," and "null" are reserved keywords.
# Case Sensitivity: YAML is case-sensitive. "myChest" and "MyChest" would be considered as two different identifiers.
# ChestSettings: This is the top-level section of the YAML configuration and acts as the main container for all chest settings.
# Chest1: This represents the first chest configuration, which we'll be using as an example. The code will look for a chest configuration with the key "Chest1." The key can be whatever you want; it serves as an identifier.
# Items: Under the "Chest1" configuration, there is an "Items" section. The code will process the items listed here to determine what should be placed in the chest's inventory. Formatting: "- ITEM_NAME:PERCENTAGE:MAX_AMOUNT"
# Biomes: This section lists the biomes in which the chest's item configuration will apply. Formatting: "- BIOME_NAME"
Example with Expanded Formatting:
Code (YAML):
ChestSettings:
Chest1:
Items
:
- MYCELIUM:30:5
- RED_MUSHROOM:20:5
- BROWN_MUSHROOM:20:5
- RED_MUSHROOM_BLOCK:10:5
- BROWN_MUSHROOM_BLOCK:10:5
- MUSHROOM_STEM:10:5
Biomes
:
- MUSHROOM_FIELDS
# The YAML above will be interpreted as follows:
# For a chest located in the "MUSHROOM_FIELDS" biome, the code will use the specified item settings to randomly populate the chest's inventory. The percentage chances and amount ranges for each item will be considered when filling the chest.
# MYCELIUM:30:5 - This line specifies an item with the name "MYCELIUM" with a chance of 30% (percentage) of being placed in the chest, and the max amount of this item is 5. The code will randomly select a value between 1 and 5 for the number of MYCELIUM to place in the chest.
Example with Compact Formatting:
Code (YAML):
ChestSettings:
Chest1:
Items
:
[WOODEN_AXE:20:1, WOODEN_PICKAXE:20:1, CROSSBOW:20:1,
...
]
Biomes
:
[BADLANDS, BAMBOO_JUNGLE, BIRCH_FOREST,
...
]
# This is a more compact way of formatting the above. Both versions are valid.
# How to format item entries: [ITEM_NAME:PERCENTAGE:MAX_AMOUNT]. If there is more than one item, you can do [ITEM_NAME:PERCENTAGE:MAX_AMOUNT, ITEM_NAME:PERCENTAGE:MAX_AMOUNT].
# If you are doing multiple biomes, this is also a more compact way of formatting it.
# How to format biome entries: [BIOME_NAME]. If there is more than one biome, you can do [BIOME_NAME, BIOME_NAME].
Sample of 10 chest from the Overworld, Nether, and End with the included Pre-Configuration.