I know how to give the player an item that can only break certain blocks, however, I want even pickaxes that are crafted to be affected by it.
I want all types of pickaxes to be only able to break certain blocks, even if it is crafted by a player. I will set what blocks it will break on my own, I just need to know the layout of the commands and I'll take it from there.
/execute as @a[nbt={SelectedItem:{id:"minecraft:diamond_pickaxe"}}] unless data entity @s SelectedItem.tag.CanDestroy run replaceitem entity @s weapon.mainhand diamond_pickaxe{CanDestroy:["someBlock"]}
/execute as @a[nbt={SelectedItem:{id:"minecraft:diamond_pickaxe"}}] unless data entity @s SelectedItem.tag.CanDestroy run replaceitem entity @s weapon.mainhand diamond_pickaxe{CanDestroy:["someBlock"]}
I got it working, however I also wanted the item to have an automatic set durability upon equipping as well, which for some reason isn't working. How can I do that?
I know how to give the player an item that can only break certain blocks, however, I want even pickaxes that are crafted to be affected by it.
I want all types of pickaxes to be only able to break certain blocks, even if it is crafted by a player. I will set what blocks it will break on my own, I just need to know the layout of the commands and I'll take it from there.
This should do:
Command block engineer // Developer // #TeamTrees
I got it working, however I also wanted the item to have an automatic set durability upon equipping as well, which for some reason isn't working. How can I do that?