#How can I give me an item that has a fast attack speed and can break specific blocks faster?
1 messages · Page 1 of 1 (latest)
you can use the tool component to make it mine tool specific blocks faster
if you want to select a custom set of blocks you'll have to raycast to detect which block the player is mining and apply an attribute modifier accordingly
The tool component works based on block tags, you can just make a tag with the specific blocks to mine faster. No need for raycasts
The default block tags are referenced in the default components, but nothing's stopping you from adding your own tags in a custom item
ty
ty also how can I add my own tags?
data/namespace/tags/block/your_tag.json
{
"values": [
"minecraft:stone"
]
}
ty so easy?
data/namespace/tags/block/your_tag.json
{
"values": [
"minecraft:[item]",
...
]
}
``` like this format?
Yeah
is use cooldown the attack speed?
nope use cooldown is the cooldown you have on throwing enderpearls
ok I found it it is attribute but wath must I putt into the things?
the attack speed is the speed at which you can attack, it's not the mining speed, thats a different attribute modifier
wath must I put into the boxes for no attack cooldown?
or fast speed?
ID: is a unique id for your specific tool
Amount: a number value used in the operation this modifier does
Operation: the operation this modifier does, for example add_value adds the value to the base of this attribute
Slot: determines in which slots this attribute is active
Display: Whether to display this attribute modifier in the tooltip
Ok ty so for a fast attack speed I must make the Amount to 1 ?
if you want to add 1 to the default attack speed then yea
ok ty
Look into the heading