Mobs don't deal damage or even chase/"target" to other players/mobs on their team if friendly fire is disabled, regardless of normal aggressive behavior. But slimes and magma cubes still do damage on contact. They will not go after teammates directly, however they will still deal damage. Iron golems on the same team will sometimes retaliate when getting damaged by a slime/magma cube on the same team as well (but the iron golem will usually "forget" about it right after. It actually targeted and attacked a zombie on the team in question once, but I couldn't replicate it).
Steps To Reproduce:
Create a new world with cheats on and a non-peaceful difficulty(Creative,Β Superflat, mob spawning off, non-peaceful works best)
Create a new team and disable friendly fire, and add yourself to it
Spawn a slime or magma cube
Add it to the team created earlier
If you are in creative mode, switch to survival mode. Then bump into the slime/magma cube. It will still deal damage.
Thank you for your report!
We're tracking this issue in MC-46956, so this ticket is being resolved and linked as a duplicate.
That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
π Bug Tracker Guidelines β π¬ Community Support β π§ Mojang Support
π Project Summary β βοΈ Feedback and Suggestions β π Game Wiki