minecraft:kinetic_weapon for you with a switch.Get GodCraftOverview
minecraft:kinetic_weapon is an item component: it goes in the components object of a custom item. Makes the item hurt mobs by charging at them, like a lance. While the item is in use, it checks every tick in a straight line where the user looks, and the hit gets stronger the faster the user and target move toward each other.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
delay | integer | 0 | Ticks to wait after starting to use the item before it can deal damage. |
reach | FloatRange | {"max":3,"min":0} | How far ahead (in blocks) targets can be hit. Blocks in the way stop the hit. |
creative_reach | FloatRange | none | Reach used in Creative mode. Uses reach if left out. |
hitbox_margin | number | 0 | Extra room around the aim line, so targets slightly off center still count. |
damage_conditions | minecraft:kinetic_weapon kinetic_effect_conditions | none | Rules (like minimum speed) that must be met for damage. Without it, no damage is dealt. |
knockback_conditions | minecraft:kinetic_weapon kinetic_effect_conditions | none | Rules that must be met to knock the target back. Without it, there is no knockback. |
dismount_conditions | minecraft:kinetic_weapon kinetic_effect_conditions | none | Rules that must be met to knock riders off their mount. Without it, riders stay on. |
damage_multiplier | number | 1 | Scales the speed-based value into damage. Bigger means harder hits. |
damage_modifier | number | 0 | A flat amount added to the damage after the multiplier. |
Example
Inside the components object of BP/items/<name>.json (values are the defaults or placeholders):
BP/items/<name>.json
{
"minecraft:kinetic_weapon": {
"delay": 0,
"reach": {
"max": 3,
"min": 0
},
"creative_reach": 1,
"hitbox_margin": 0,
"damage_conditions": {},
"knockback_conditions": {},
"dismount_conditions": {},
"damage_multiplier": 1
}
}