Thank you but I needed something that removes AI from future mobs.
If you want to remove it from future mobs as well, put that command into a repeating command block that is always active. It will disable a mob's AI as soon as it spawns
If you want to remove it from future mobs as well, put that command into a repeating command block that is always active. It will disable a mob's AI as soon as it spawns
This will make the command not even attempt to alter an entity that it has already altered. In a world with several other mechanisms it is crucial to be as accurate as you can. Minimizing any and all possible unnecessary iterations. Sure in this case it seems unreasonable, but when you start doing things that require over 100 command blocks, it is necessary to already have this habit of writing, otherwise you will have unavoidable amounts of lag making it impossible to continue without learning this the hard way and starting all over.
It actually has one very important difference, the "b". It sets the variable type to byte, while leaving it off is an int. Since NoAI is a byte we must feed it a byte or it will throw the data out entirely.
Hi, is there a command to disable the AI for every mob at once (like in Garry's Mod and Skyrim)?
Or is there a mod that allows this?
Hello friend.
Use the command /entitydata @e {NoAI:1}
This will remove AI from all entities that have already spawned.
Thank you but I needed something that removes AI from future mobs.
Hello friend.
If you want to remove it from future mobs as well, put that command into a repeating command block that is always active. It will disable a mob's AI as soon as it spawns
You are a true master, thanks bro.
Hello friend.
To make this just that much better, still accomplishing the same task, but in certain circumstances creating much less lag. Use this command instead:
/entitydata @e[tag=!handled] {NoAI:1,Tags:["handled"]}
This will make the command not even attempt to alter an entity that it has already altered. In a world with several other mechanisms it is crucial to be as accurate as you can. Minimizing any and all possible unnecessary iterations. Sure in this case it seems unreasonable, but when you start doing things that require over 100 command blocks, it is necessary to already have this habit of writing, otherwise you will have unavoidable amounts of lag making it impossible to continue without learning this the hard way and starting all over.
These commands didn't work when I put them in a command block. Are there only certain mobs it works on?
Hello friend.
Did you use
/entitydata @e[tag=!handled] {NoAI:1,Tags:["handled"]}
or
/entitydata @e {NoAI:1}
Use this:
/entitydata @e[tag=!handled] {NoAI:1b,Tags:["handled"]}
That's what you said already. I did.
Hello friend.
The command that nigathan gave should work on all mobs. What error does the command block give?
It actually has one very important difference, the "b". It sets the variable type to byte, while leaving it off is an int. Since NoAI is a byte we must feed it a byte or it will throw the data out entirely.
/entitydata @e[type=<Mob>] {NoAI:1}
/summon <Mob> ~ ~ ~ {NoAI:1}
/scoreboard players tag @e[type=<Mob>] add <Tag>
/entitydata @e[type=<Mob>] {NoAI:1,Tags:[<Tag>]}
So, there are different ways to add tags
Adding tags is not the question; Just a way to reduce lag.
I was just trying to help those does not know how to add tags and NoAI tag does relate to this question