Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Monster Box's spawn functionality work with a stack of multiple spawn eggs #5040

Open
Ldawsonm opened this issue Sep 2, 2024 · 0 comments

Comments

@Ldawsonm
Copy link

Ldawsonm commented Sep 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant