-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
This server is running CraftBukkit version 3616-Spigot-d90018e-eecb4c0 (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT)
-
Yes
It seems like when spawning entities using a spawn egg their spawn reason is "DEFAULT" instead of "SPAWNER_EGG". I dig into the code and it seems like the spawn reason parameter is not used:
SpawnEggItem#useOn calls EntityType#spawn:
@Nullable public T spawn(ServerLevel worldserver, @Nullable ItemStack itemstack, @Nullable Player entityhuman, BlockPos blockposition, MobSpawnType enummobspawn, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) { // CraftBukkit end CompoundTag nbttagcompound; Consumer<T> consumer; // CraftBukkit - decompile error if (itemstack != null) { nbttagcompound = itemstack.getTag(); consumer = EntityType.createDefaultStackConfig(worldserver, itemstack, entityhuman); } else { consumer = (entity) -> { }; nbttagcompound = null; } return this.spawn(worldserver, nbttagcompound, consumer, blockposition, enummobspawn, flag, flag1); }
There the spawnReason is correct, however not used to spawn the entity.
Then, the last EntityType#spawn call has its spawn reason set always to "DEFAULT", causing this behavior.