I am running a command, but I want to use it for only items that aren't a few. Is there a way to make an entity untouchable by commands?
1 Answer
Ok. I figured it out. You should use a tag
scoreboard players tag @e[put whatever you want here] add example
That would add a tag to any item you want. Then, you do your buisness, while adding "tag=!example" in selector. For instance:
tp @e[tag=!example] ~ ~20 ~
or
entitydata @e[tag=!example] {CustomName:"I am touched by the command"}
In this case, "example" is the name of a tag. You don't need to do anything else to make it work. You just add any tag you want to any entity with the first command, and it's all set to be added to selectors.
And, to answer the initial question, no, it's impossible to make entity completely ntouchable by any commands. The only 2 solutions are:
- Killing the entity
- Using additional selector modifications, like tags, radius, number, e.t.c
-
Im kinda confused. Could you please expand on what "example" is– DavidCommented Jun 5, 2016 at 19:31
-
1This doesn't fulfill the desired action. Untouchable appears to mean the NBT data can't be modified, and this can also be touched by a normal command.– user140963Commented Jun 5, 2016 at 19:56
-
2Affiliation to what?– user11502Commented Jun 12, 2016 at 23:08