Make Monster Box's spawn functionality work with a stack of multiple spawn eggs
Ldawsonm opened this issue ยท 0 comments
So, as it stands, the way monster boxes work is they get a set of item stacks from the monster box loot table, then for each item stack, it spawns the monster. However, the logic does not account for the possibility of the item stack having a count of more than one. This is fine for most uses, but it limits the possibilities of how the monster box could work. And the solution would be very straight forward: Just add a for loop inside the if condition if(stack.getItem() instanceof SpawnEggItem egg)
at MonsterBoxEntity.spawnMobs() and have it iterate over a range equal to the stack size.
Edit: I should add that technically you can replicate the set_count
behavior by having the loot table entry type be a loot table instead of an item, then you can control the number spawned via the rolls
tag for the pool, which can be a number provider