ItemComponent - Tool Rule Apply (Section) — SkBee
Addon: SkBee · Category: Section · Since: 3.8.0
Syntax
apply tool ruleDescription
Apply rules to a tool component. You can add as many as you'd like. See [**McWiki Tool Component**](https://minecraft.wiki/w/Data_component_format#tool) for more details.
**Entries/Sections**: NOTE: One of either `block_types` or `block_tag` MUST be used. `blocks` = The blocks to match for this rule to apply (Supports ItemTypes, BlockDatas, Minecraft Tags and TagKeys). `speed` = If the blocks match, overrides the default mining speed (Must be a positive number). [Optional] `correct for drops` = If the blocks match, overrides whether or not this tool is considered correct to mine at its most efficient speed, and to drop items if the block's loot table requires it. [Optional]
Examples
set {_i} to a stick
apply tool component to {_i}:
default_mining_speed: 2.3
damage_per_block: 2
rules:
apply tool rule:
blocks: minecraft block tag "minecraft:all_signs" # Shown as a Minecraft block tag
speed: 1.0
correct_for_drops: true
apply tool rule:
blocks: stone, granite, andesite and gravel # Shown as a list of ItemTypes
speed: 0.5
correct_for_drops: false
give {_i} to player