Minecraft – How to make mobs not attack each other

minecraft-commandsminecraft-java-edition

I'm making a custom boss battle where it spawns mobs to fight for it, but the skeletons attack each other. How can I prevent this from happening in Minecraft 1.16.5?

I am using custom commands to summon the mobs, and I put them on the team EndMobs However, when I tried to spawn it with the tag {Team:EndMobs}, the command output says, "Unable to add mob to team. Are you sure the team exists?"

However, when i tried looking at the team, it said [EndMobs] so I decided to add the mob to [EndMobs] instead, and this time, console didn't throw out an error, so I assumed it worked. However, even if I modify the team with friendly fire off, they still attack each other. When one tries to shoot the player, they end up shooting another mob.

Best Answer

I have a theory, but it is only if you are currently in creative mode. Otherwise, I can not think of any other way to solve this. My theory is that you have to be in survival mode to make the skeletons fight you.