mojira.dev
MC-73881

Summoning monsters in peaceful difficulty spawns monster for 1 tick

The bug

When you summon a monster, it does not only flash, but also really exists for one tick. This may cause unnecessary CPU usage because the pathfinding algorithm maybe already starts.

How to reproduce

  1. Set difficulty to peaceful

  2. Place a command block with this command: /summon zombie ~ ~1 ~

  3. Place a chain command block after it with this command: /execute if entity @e[type=minecraft:zombie,distance=..4] run say ZOMBIE DETECTED

  4. Activate the first command block
    β†’ ❌ Observe how the command block said "ZOMBIE DETECTED"

Linked issues

Attachments

Comments 24

i think this is intended

Intended, also if this is a peaceful world, why would you wan't to summon aggressive mobs?
I think they won't naturally spawn with the difficulty on peaceful.

But there should be still some code which checks first if the difficulty is not peaceful I guess and only then summon a zombie (or any other monster) πŸ˜‰

Confirmed for 1.13.1. Since /testfor is gone, i'll comment a updated version on how to test it, please copy/paste or link this in the description.

How to reproduce

  1. Set difficulty to peaceful.

  2. Make a chain of two command blocks, first one command block:Β /summon Zombie ~ ~1 ~ make it repeat, second command block, make it chain with this command:Β /execute if entity @e[type=minecraft:zombie,limit=4] run say ZOMBIE DETECTED

  3. Place a lever on the repeat command, active it.

  4. Observe how it will spam chat with 'ZOMBIE DETECTED'

Affects 20w07a. Can I request ownership?

14 more comments

Can confirm in 1.19.1.

Can confirm in 1.19.2.

Can confirm in 1.21.4.

This bug isn’t fully fixed in 25w31a

[media]

Seems to have been fixed for commands, but not for spawn eggs. Edit: new ticket is MC-300057.

Marcono1234

muzikbike

(Unassigned)

Confirmed

Platform

Low

Mob spawning

/summon, difficulty, mixed-bugs-hallway, monster, peaceful, spawn, tick

Minecraft 1.8.1-pre3, Minecraft 16w05a, Minecraft 16w40a, Minecraft 1.11.2, Minecraft 1.13.1, ..., 1.19, 1.19.1, 1.19.2, 1.20.3 Release Candidate 1, 1.20.4

25w31a

Retrieved