Quantcast
Viewing latest article 20
Browse Latest Browse All 49

Answer by Skylinerw for Problem with scoreboard finding named and enchanted item

The error message might not be too useful since, when receiving it via a command block, it only concerns the last iteration of the command. In this case, the last item entity that had its NBT data checked. If the item you want found is indeed found, but there's another item lying around somewhere that's next in line to check, the error is going to be about that incorrect item even though the command was actually successful.

That being said, the id and lvl tags for enchantments have the datatype "short", assuming that you're targeting an item that was enchanted normally or provided to the player with the correct datatypes. As well, the ench tag itself does not go inside the display compound.

You might also run into an issue by adding 1 to its score instead of setting their score to 1. If the other commands are not run in the same tick after /scoreboard runs, then the score might end up being set to 2 or higher, and thus will never be found later on.

/scoreboard players set @e[type=Item] nightVeil 1 {Item:{tag:{display:{Name:"Night's Veil"},ench:[{id:22s,lvl:1s}]}}}

You do not need a nested /execute command, especially one that targets all entities and not just the player you're trying to target. Just move the parameters into the selector in /effect.

/execute @e[type=Item,score_nightVeil_min=1,score_nightVeil=1] ~ ~ ~ /effect @p[r=1] minecraft:invisibility 45 0

/kill does not support NBT data. If you were intending to target the item from before, you can target it based on its score you had already given it:

/kill @e[type=Item,score_nightVeil_min=1,score_nightVeil=1]

If you were intending to target a different item altogether, you need to give it a score of its own based on its NBT data and then /kill based on its score, just as you've done already.


Viewing latest article 20
Browse Latest Browse All 49

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>