Item Components
Vibranium adds a few data components that can be applied to items.
Blocks Fall Damage
When an item with this component is being used and the player is looking down at an angle above the specified angle, all fall damage will be canceled.
| Field | Default | Description |
|---|---|---|
min_angle |
60 | The minimum angle that the player has to be looking down to cancel fall damage. For reference, 0 is looking straight forward, 90 is looking directly down, and -30 is looking 30 degrees up. |
disabled_by_sonar |
false | If true and the entity is affected by sonar, then fall damage will not be canceled. |
Examples:
addon/test/item/soft_thing.json
{
"type": "minecraft:item",
"properties": {
"components": {
"vibranium:blocks_fall_damage": {
"min_angle": 45
},
"minecraft:consumable": {
"consume_seconds": 999999,
"has_consume_particles": false,
"animation": "block",
"sound": "entity.generic.small_fall"
}
}
}
}
The consumable component just allows the item to be used.
Ground Slam
When an item with this component is being used by the player and the player lands, a ground slam will be initiated. The slam will damage and push nearby entities, spawn particles, make a sound, and give the player some upwards momentum. Fall damage will not be canceled. The maximum attainable strength for the slam is capped at 16, which equates to 8 HP dealt if the player lands directly on an entity (the slam strength felt by each entity falls off with distance squared).
| Field | Default | Description |
|---|---|---|
multiplier |
1.0 | The multiplier for the ground slam's strength. |
min_angle |
60 | The minimum angle that the player has to be looking down to initiate the ground slam. |
disabled_by_sonar |
false | If true and the entity is affected by sonar, then the ground slam will not initiate. |
Examples:
addon/test/item/heavy_thing.json
{
"type": "minecraft:item",
"properties": {
"components": {
"vibranium:ground_slam": {
"multiplier": 0.5
},
"minecraft:consumable": {
"consume_seconds": 999999,
"has_consume_particles": false,
"animation": "block",
"sound": "entity.generic.small_fall"
}
}
}
}
Kryptonite
This component makes an item act like Kryptonite; it will disable nearby powers in the #vibranium:is_dampened_by_kryptonite tag when held, worn (in an armor slot), dropped, or displayed in an item frame.
| Field | Default | Description |
|---|---|---|
range |
5.0 | The radius of effect for the item's power dampening. |
time |
30 | The maximum time, in ticks, that the dampening effect can last for. |
hit_time |
600 | When an entity is attacked by this item, kryptonite powers will be dampened for this amount of time. |
impermeable |
<no blocks> | A HolderSet of the blocks that must not be between the item and the entity being dampened. A suggested value for this field is #vibranium:kryptonite_impermeable. |
Examples:
addon/test/item/kryptonite_helmet.json
{
"type": "minecraft:armor",
"armor_material": "test:kryptonite",
"armor_type": "helmet",
"properties": {
"components": {
"vibranium:kryptonite": {
"impermeable": "#vibranium:kryptonite_impermeable"
}
}
}
}
Modify on Break
This component applies Item Modifier(s) when the item it is applies to runs out of durability. Keep in mind that the modifier probably should set the ItemStack's count and/or durability back above zero, as well as remove itself from the item (so it doesn't fire again).
| Field | Default | Description |
|---|---|---|
modifiers |
<required> | A single or list of modifier identifier(s). Points to data/namespace/item_modifier/. |
Examples:
addon/test/item/second_wind_chestplate.json
{
"type": "minecraft:armor",
"armor_material": "diamond",
"armor_type": "chestplate",
"properties": {
"components": {
"vibranium:modify_on_break": {
"modifiers": [ "test:change_to_iron_chestplate" ] // this can be a single identifier or an array
}
}
}
}
data/test/item_modifiers/change_to_iron_chestplate.json
[
{
"function": "minecraft:set_item",
"item": "minecraft:iron_chestplate"
},
{
"function": "minecraft:set_count",
"count": 1
},
{
"function": "minecraft:set_damage",
"damage": 0.9
},
{
"function": "minecraft:set_components",
"components": {
"!vibranium:modify_on_break": {} // the exclamation point makes it remove the component
}
}
]
Vertically Bounded Blocks Attacks
This component takes effect when an item with it is used or equipped. When damage is taken, this component checks the vertical offset of the damage and blocks it if it is between the specified lower and upper bounds; i.e. if the player is hit on the head by an anvil, that damage would have a vertical offset of 1 (100% of the player's hitbox), but if they are punched in the legs, the vertical offset would be closer to 0.3 or 0.4.
| Field | Default | Description |
|---|---|---|
damage_type |
<all damage types> | A HolderSet of the damage type(s) / tag(s) to block. If not specified, all damage types will be blocked. |
lower_bound |
0.0 | The lower bound for the damage to be blocked. 0 means the bottom of the entity's hitbox. |
upper_bound |
1.0 | The upper bound for the damage to be blocked. 1 means the top of the entity's hitbox. |
disabled_by_sonar |
false | If true and the entity is affected by sonar, then the damage will not be blocked. |
Examples:
addon/test/item/protective_chestplate.json
{
"type": "minecraft:armor",
"armor_material": "test:protective_material",
"armor_type": "chestplate",
"properties": {
"components": {
"vibranium:vertically_bounded_blocks_attacks": {
"damage_type": "#minecraft:is_projectile",
"lower_bound": 0.5,
"upper_bound": 0.75
}
}
}
}
Base Content
For Developers
- Ability Types
- Action Types
- Condition Types
- Item Types
- Item Components
- Dampening
- Feature Flags