I'm working on a system for rpg type skills using command blocks in 1.9 in fleshing out a skill now "Mining" I set the player using a pickaxe to adventure mode then assign their pickaxe a quality based on the material...
I need to replace whatever pickaxe they are holding with one that has the appropriate candDestroy data tags based on their level of the mining skill...here is my attempt, but it's my first time using the command
/replaceitem entity @a[tag=Mining,r=0,score_Skill_Mining=0,score_Skill_Mining_min=0] slot.weapon.mainhand minecraft:wooden_pickaxe 1 ~ {CanDestroy:["minecraft:stone"]}
the ~ is my area of concern....I don't know how for it to keep the damage value of the pick they are holding...if there is a solution or alternate method please let me know
I need to replace whatever pickaxe they are holding with one that has the appropriate candDestroy data tags based on their level of the mining skill...here is my attempt, but it's my first time using the command
/replaceitem entity @a[tag=Mining,r=0,score_Skill_Mining=0,score_Skill_Mining_min=0] slot.weapon.mainhand minecraft:wooden_pickaxe 1 ~ {CanDestroy:["minecraft:stone"]}
the ~ is my area of concern....I don't know how for it to keep the damage value of the pick they are holding...if there is a solution or alternate method please let me know
3
Yes it'd be sick.
DepthStrider A question though, is it for multiplayer?
Yes it is for multiplayer. currently I have it running on a realm...it along with a lot of other things are all working along side with little impact...I try very hard to code things so they only run when they need to.
I thought of how to make it work...i just realized that people are going to have to craft the pickaxe so I can just set it then...the problem only matters with the thought they will trade, but for now just making it trigger only on new pickaxes will work... hopes for 1.10 or any large update between is a /itemdata that would be so amazing.
That's the thing. The replaceitem command does what it implies, replaces, overrides an item. Completely. If you want it to work it's extreme hard coding that'll make it work. Simply put there is no way to keep certain parts of a replaceitem command, what's in it is what replaces the old item. No variables allowed in the syntax. The same goes for all other commands. Pretty sure you're out of luck. A question though, is it for multiplayer?
