#Item durability
1 messages · Page 1 of 1 (latest)
for a specific block you’d need the “minecraft:on_use_on” behaviour, then have to specify the target block, which is in your case your custom barbed wire block, then have it activate an event which both destroys the barbed wire and damages the wire cutter
incase you haven’t already, you’ll also need to give the wire cutters a set durability with the “minecraft:durability” behaviour
@stiff venture
and you can probalby add "value": "minecraft:dirt" for a specific block
i think, but maybe don't use mcpe as a namespace, it is very common
this?
okay i found it
it's for example to make some items block placer, but those items are only placeble ojn certain blocks
on use on i guess
and then you make an event that decreases when the event is called
minecraft:on_use is used for simply launching an event upon right clicking, while minecraft:on_use_on is for launching an event when the item was used onto something you can also specify the target with a molang query to determine if it was used on the desired target or not, returning 1 or 0, if you get 1 that means that the query detected the correct target and is launching the event while 0 means that the query failed to detect it and it also failed to run the event, for the durability damage just use damage event if the correct tool was used, there is another method and that utilizes your custom block and that is by using the minecraft:on_interact block component where you can specify if the correct tool was used, with also a molang query and then just run the damage event
Hope this helps a bit, you can always check the wiki/docs to get more information on this matter.
sorry for the late reply, do you still want some examples or have you figured it out whilst waiting?
i’ll try and write it up for you at some point and send it over