Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-88099

Slimes/magma cube with NoAI-Tag still can damage the player

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 18w30a
    • Minecraft 1.8.8, Minecraft 15w36b, Minecraft 15w36c, Minecraft 15w36d, Minecraft 15w37a, Minecraft 15w38a, Minecraft 15w38b, Minecraft 15w45a, Minecraft 1.8.9, Minecraft 15w51b, Minecraft 16w02a, Minecraft 16w06a, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 1.9.3 Pre-Release 1, Minecraft 1.9.3 Pre-Release 2, Minecraft 1.9.3 Pre-Release 3, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 16w21a, Minecraft 16w21b, Minecraft 1.10 Pre-Release 1, Minecraft 1.10 Pre-Release 2, Minecraft 1.10, Minecraft 1.10.1, Minecraft 1.10.2, Minecraft 16w43a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, Minecraft 1.11.2, Minecraft 1.12 Pre-Release 6, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w50a, Minecraft 18w05a, Minecraft 18w22c, Minecraft 1.13-pre1, Minecraft 1.13-pre2, Minecraft 1.13-pre3, Minecraft 1.13-pre4, Minecraft 1.13-pre6, Minecraft 1.13-pre7, Minecraft 1.13-pre8, Minecraft 1.13
    • None
    • Confirmed

      The bug

      When summoning a slime with the Tag NoAI:1b it can still damage the player.

      How to reproduce

      1. /difficulty hard
      2. /summon slime ~ ~ ~ {Size:3,NoAI:1b}
      3. /gamemode survival
      4. Walk into the slime and die a slimy death

      Video: https://youtu.be/ZkI3uU7hoBA?t=2m33s

      Fix

      Having in mind the overall AI-System this is a hack. See note below.
      There is a method canDamagePlayer() in EntitySlime.java. A check can simply be added there.

      EntitySlime.java (in MCP)
      	...
      	protected boolean canDamagePlayer() {
      		// Added && !this.isAIDisabled()
      		return this.getSlimeSize() > 1 && !this.isAIDisabled();
      	}
      	...
      

      @EDIT I didn't find MC-67667 somehow. Searges comment declares it as "Won't fix".
      I still think this should be changed as damaging logically would be part of the AI, even if it's not directly inside the AI code.

      Note: As Torabi pointed out in his comment, this is probably not so much viewed as "Won't fix", but rather will likely get fixed properly in future by moving this part of entity behaviour to the AI-Code.
      Looking at it, it looks like a simple task at the beginning, but soon you realize that it probably would make sense to relocate the EntitySlime in the class hierarchy and I think form there it will feel like this soon. It's understandable why it gets ranked less important than other issues for now.

            rockenroll4life rockenroll4life (Josh Letellier)
            panda4994 [Mojang] Panda
            Votes:
            57 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: