I'm making a zombies map an intend to use a hopper and a button to make a pack a punch system. All I need to know is how to execute if a specific weapon with specific enchantments or no enchantments in inside of the hopper.
I want to be able to do this with a iron_axe for example
to pack a punch you put the axe in the hopper and press the button right above it. it also test for your "points" to make sure it is 5000 or above
If you do the same weapon once it is enchanted. "always with sharpness 2" it will give it sharpness 3 and knockback 1.
Now that I think about this idea would work better with an item frame.
at least i know there is a way to test for a specific item in an item frame but is there a way I could test for specific enchantments or test if there is no enchantments for said item in the item frame?
Uuuuh it's old, there's no answer, but it's simple :
In 1.13 (You didnt give your playing version) :
This exemple make all item frames with command blocks into them to say "It works!" :
/execute as @e[type=minecraft:item_frame,nbt={Item:{id:"minecraft:command_block",Count:1b}}] run say It works!
Then, this one has the same effect, but with additional tag (Command block renamed as "Test") :
/execute as @e[type=minecraft:item_frame,nbt={Item:{id:"minecraft:command_block",Count:1b,tag:{display:{Name:"{\"text\":\"Test\"}"}}}}] run say It works!
Rollback Post to RevisionRollBack
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
I'm making a zombies map an intend to use a hopper and a button to make a pack a punch system. All I need to know is how to execute if a specific weapon with specific enchantments or no enchantments in inside of the hopper.I want to be able to do this with a iron_axe for exampleto pack a punch you put the axe in the hopper and press the button right above it. it also test for your "points" to make sure it is 5000 or aboveIf you do the same weapon once it is enchanted. "always with sharpness 2" it will give it sharpness 3 and knockback 1.Now that I think about this idea would work better with an item frame.
at least i know there is a way to test for a specific item in an item frame but is there a way I could test for specific enchantments or test if there is no enchantments for said item in the item frame?
Uuuuh it's old, there's no answer, but it's simple :
In 1.13 (You didnt give your playing version) :
This exemple make all item frames with command blocks into them to say "It works!" :
Then, this one has the same effect, but with additional tag (Command block renamed as "Test") :
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).