-
Notifications
You must be signed in to change notification settings - Fork 1
ItemStack (ItemStackReader)
BlobLib allows constructing items directly from YAML files. This is useful in cases such as TranslatableItem (having items that translate during runtime) and BlobInventory (user interfaces used in plugins that allow server administrators to customize them to their liking, even translating during runtime).
Material: "DIAMOND_SWORD"
Amount: 1
# ... other options ...All options are optional except Material. Unspecified fields use plugin defaults.
Below is a comprehensive list of fields you can set for each custom item:
-
Type:
String - Required: Yes
-
Description: The base material for the item. Must be a valid
Materialenum, e.g.,STONE,DIAMOND_PICKAXE. For player heads, useHEAD-<base64_url>.
-
Type:
Integer - Required: No
-
Default:
1 -
Range:
1to127 - Description: Stack size of the item.
-
Type:
Integer - Required: No
-
Default:
0 - Description: Initial damage value for tools/armor.
-
Type:
Integer - Required: No
-
Default:
0 - Description: Repair cost applied when an anvil is used.
-
Type:
Section -
Required: No
-
Fields:
-
TrimMaterial(String): Key of the trim material. -
TrimPattern(String): Key of the trim pattern.
-
-
Description: Applies a visual trim to armor items.
-
Type:
String - Required: No
-
Description: Custom display name, supports standard '&' color codes (e.g.,
&6Excalibur).
-
Type:
Boolean - Required: No
-
Default:
false - Description: Hides the tooltip on hover.
-
Type:
Boolean - Required: No
-
Default:
false - Description: Toggles the enchantment glint regardless of actual enchantments.
-
Type:
Boolean - Required: No
-
Default:
false - Description: Makes the item immune to fire/lava.
-
Type:
Integer - Required: No
- Default: Material default
- Description: Overrides the maximum stack size.
-
Type:
Integer - Required: No
- Default: Material default
- Description: Sets the maximum durability. Must be ≥ 0.
-
Type:
String - Required: No
-
Values: Enum
ItemRarity, e.g.,COMMON,UNCOMMON,RARE,EPIC - Description: Rarity indicator in lore.
-
Type:
String - Required: No
-
Format:
<namespace>:<path> - Description: Custom style key for advanced tooltip formatting.
-
Type:
Section -
Required: No
-
Fields:
-
EquipmentSlot(String) -
CameraOverlay(String,<namespace>:<path>, optional) -
EquipSound(String,<namespace>:<path>, optional) -
AssetId(String,<namespace>:<path>, optional) -
AllowedEntities(String, tag key, optional) -
DamageOnHurt(Boolean) -
Dispensable(Boolean) -
Swappable(Boolean)
-
-
Description: Defines entity equipment behavior.
-
Type:
Boolean - Required: No
- Description: Grants gliding capability (elytra-like).
-
Type:
Section -
Required: No
-
Fields:
-
ConsumeSeconds(Float) -
HasConsumeParticles(Boolean) -
Animation(String, enumItemUseAnimation)
-
-
Description: Makes the item consumable.
-
Type:
Section -
Required: No
-
Fields:
-
DamagePerBlock(Integer) -
DefaultMiningSpeed(Float) -
Rules(Section):- customBlockstags,Speed(Float),CorrectForDrops(Boolean)
-
-
Description: Configures tool behavior, mining speeds, and block-specific rules.
-
Type:
Section -
Required: No
-
Fields:
-
Nutrition(Integer) -
Saturation(Float) -
CanAlwaysEat(Boolean)
-
-
Description: Sets food properties when consumed.
-
Type:
String - Required: No
- Description: Sets the item’s display name, supports standard '&' color codes.
-
Type:
List<String> - Required: No
-
Description: Adds description lines to the item, supports standard '&' color and format codes (e.g.,
&o&7A legendary sword).
-
Type:
Boolean - Required: No
-
Default:
false - Description: Makes the item unbreakable.
-
Type:
String - Required: No
-
Format: any CSS-style color (e.g.,
#RRGGBB) - Description: Applies a color to leather armor or full-color items.
-
Type:
List<String> - Required: No
-
Description: List of enchantments, format
ENCHANTMENT_NAME:LEVEL.
-
Type:
Section - Required: No
-
Subfields: dynamic attribute keys, each with
Amount,Operation, optionalEquipmentSlotGroup - Description: Adds attribute modifiers (e.g., attack damage, speed).
-
Type:
List<String> - Required: No
-
Description: Hides default item flags via Bukkit
ItemFlagname.
Material: "DIAMOND_SWORD"
Amount: 1
RepairCost: 10
Rarity: "EPIC"
ItemName: "&6Excalibur"
Lore:
- "&o&7A legendary sword"
- "&l&4Unmatched in power"
Enchantments:
- "DAMAGE_ALL:5"
- "LOOT_BONUS_MOBS:3"
Consumable:
ConsumeSeconds: 1.5
HasConsumeParticles: true
Animation: "EAT"
Attributes:
ATTACK_SPEED:
Amount: 1.2
Operation: ADDITION
MAX_HEALTH:
Amount: 4.0
Operation: MULTIPLY_BASE