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

Numerous Entity interactions bypass /is limits #184

Open
Alasdairbugs opened this issue Apr 8, 2024 · 12 comments
Open

Numerous Entity interactions bypass /is limits #184

Alasdairbugs opened this issue Apr 8, 2024 · 12 comments
Assignees
Labels
in progress being worked on

Comments

@Alasdairbugs
Copy link

Expected behavior

/is limits should restrict entities spawning or persisting if the limit is maximised to a figure set in the config file.

Observed/Actual behavior

Multiple entities ignore this.

  • Iron Golem
  • Villager
  • Zombie Pigman
  • Witch

to name a few. Possibly additional entities

  • slime
  • magma cube
  • zombie

Steps/models to reproduce

The entities listed can bypass the limits in several ways

  • Lightning strikes villagers, converting to witches which can bypass the limit. Natural mob spawns can also spawn additional witches despite the limit being reached in this way from observations.
  • villagers in immediate danger can spawn iron golems which seem to bypass limit if other golems are built in another section of the island, far away.
  • pigs struck by lightning to zombie pigman can bypass the limit
  • villagers can bypass limit by breeding from observations

My thoughts are that not all possible ways of generating an entity are considered, so the limit for which a mob is counted for is not checked in some way.

therefore, zombie reinforcement spawning, or silverfish spawning from infested blocks or endermite generation, zombie pigman portal generation, etc., are perhaps not considered too (untested).

BentoBox version

[22:30:31 INFO]: Running PAPER 1.20.4.
[22:30:31 INFO]: (git-Paper-463 (MC: 1.20.4))
[22:30:31 INFO]: BentoBox version: 2.2.0
[22:30:31 INFO]: Database: JSON
[22:30:31 INFO]: Loaded Game Worlds:
[22:30:31 INFO]: bskyblock_world (BSkyBlock): Overworld
[22:30:31 INFO]: Loaded Addons:
[22:30:31 INFO]: Bank 1.7.1 (ENABLED)
[22:30:31 INFO]: Biomes 2.1.1 (ENABLED)
[22:30:31 INFO]: BSkyBlock 1.17.1 (ENABLED)
[22:30:31 INFO]: Challenges 1.1.0-SNAPSHOT-LOCAL (ENABLED)
[22:30:31 INFO]: ControlPanel 1.13.1 (ENABLED)
[22:30:31 INFO]: DimensionalTrees 1.7.0 (ENABLED)
[22:30:31 INFO]: Likes 2.3.0 (ENABLED)
[22:30:31 INFO]: Limits 1.19.0 (ENABLED)
[22:30:31 INFO]: Visit 1.4.0 (ENABLED)
[22:30:31 INFO]: Warps 1.14.0 (ENABLED)

Plugin list

[22:29:58 INFO]: Server Plugins (50):
[22:29:58 INFO]: Paper Plugins:
[22:29:58 INFO]: - Minepacks
[22:29:58 INFO]: Bukkit Plugins:
[22:29:58 INFO]: - AdvancedRegionMarket, AltDetector, BentoBox, BentoBox-Bank, BentoBox-Biomes, BentoBox-BSkyBlock, BentoBox-Level, BentoBox-Warps, BlockLocker, ChestShop
[22:29:58 INFO]: CoreProtect, CraftingStore, DecentHolograms, DiscordSRV, EpicRename, Essentials, EssentialsAntiBuild, EssentialsChat, EssentialsSpawn, ExcellentCrates
[22:29:58 INFO]: ExecutableItems, HeadDatabase, ImageOnMap, InsaneAnnouncer, InvSeePlusPlus, InvSeePlusPlus_Clear, InvSeePlusPlus_Give, *isSlimeChunk, LuckPerms, MobsManager
[22:29:58 INFO]: MossTweaks, NexEngine, PlaceholderAPI, Pladdon, PlayerParticles, ProtocolLib, PvPManager, SCore, SuperVanish, Vault
[22:29:58 INFO]: ViaBackwards, ViaVersion, VillagerOverhaul, Votifier, VotifierPlus, VotingPlugin, Vulcan, WorldEdit, WorldGuard

Other

No response

@tastybento
Copy link
Member

Hmm, in the code, the CreatureSpawnEvent should catch most, if not all of these:

Lightning strikes villagers, converting to witches which can bypass the limit.

Lightning strikes should be handled.

Natural mob spawns can also spawn additional witches despite the limit being reached in this way from observations.

Natural spawning is blocked if the entity is limited, so this should not happen.

villagers in immediate danger can spawn iron golems which seem to bypass limit if other golems are built in another section of the island, far away.

Village defense is a spawn reason and would be caught too.

pigs struck by lightning to zombie pigman can bypass the limit

This is a lightning strike event and caught too.

villagers can bypass limit by breeding from observations

This may be possible, but I would have to test.

Do you have evidence that these spawns actually occur? It's going to be extremely difficult to test things like lightning strikes.

@Alasdairbugs
Copy link
Author

Make a lightning rod and place it near some entities that were spawned in, set the weather to storm for example.

Place 10 villagers and 15 beds, set the island villager limit to 12, and the villagers should over breed.

Build an iron golem, set the limit to 1, scare the villagers you made earlier with a zombie. (If not for them having spawned a golem already).

Otherwise I can get some evidence tomorrow I suppose.

@tastybento
Copy link
Member

That's useful. All of those should be covered so I'd be interested to see if they happen.

@Alasdairbugs
Copy link
Author

hi there, here is a video https://youtu.be/Un7C1f_TGk8

plugins and bbox version listed in original post.

@tastybento
Copy link
Member

Very useful!!

@Alasdairbugs
Copy link
Author

Hiya any update on this? im not sure if you've been able to reproduce any of these.

I'm fairly certain this is a bug with bentobox given that we've had it for so long, through multiple versions. I'd be willing to put a ~17 USD bounty onto this if I can verifiably see it fixed and working. Perhaps 5 for reproducing, 12 for fixing. Thanks.

@tastybento
Copy link
Member

tastybento commented May 19, 2024

I'm running 1.21.0-SNAPSHOT. I added debug and tested and these are fixed:

  • Villages hit by lighting and bypassing witches - done
[15:22:39 INFO]: LSPVickyToo issued server command: /lightning
[15:22:39 INFO]: Villager Villager['Villager'/493, uuid='7e8d1132-05e0-48cc-a1d9-1efcb85b4471', l='ServerLevel[acidisland_world]', x=28002.50, y=74.00, z=-8799.50, cpos=[1750, -550], tl=961, v=true] was struck by lightning LightningBolt['Lightning Bolt'/545, uuid='3a38e4fc-e8b6-48e4-8b59-487069cdbf01', l='ServerLevel[acidisland_world]', x=28002.00, y=73.00, z=-8800.00, cpos=[1750, -550], tl=1, v=true].
[15:22:39 INFO]: [BentoBox] DEBUG: CreatureSpawnEvent WITCH
[15:22:39 INFO]: [BentoBox] DEBUG: CreatureSpawnEvent result is (false = not allowed) : false
[15:22:39 INFO]: Villager Villager['Villager'/494, uuid='a959dfa7-8551-447b-98e8-fcf085527c64', l='ServerLevel[acidisland_world]', x=28004.50, y=74.00, z=-8799.50, cpos=[1750, -550], tl=920, v=true] was struck by lightning LightningBolt['Lightning Bolt'/545, uuid='3a38e4fc-e8b6-48e4-8b59-487069cdbf01', l='ServerLevel[acidisland_world]', x=28002.00, y=73.00, z=-8800.00, cpos=[1750, -550], tl=1, v=true].
[15:22:39 INFO]: [BentoBox] DEBUG: CreatureSpawnEvent WITCH
[15:22:39 INFO]: [BentoBox] DEBUG: CreatureSpawnEvent result is (false = not allowed) : false
  • Lightning hitting pigs also will not breach the zombified piglin limit:
[15:30:43 INFO]: LSPVickyToo issued server command: /lightning
[15:30:43 INFO]: [BentoBox] DEBUG: CreatureSpawnEvent ZOMBIFIED_PIGLIN
[15:30:43 INFO]: [BentoBox] DEBUG: CreatureSpawnEvent result is (false = not allowed) : false
[15:30:43 INFO]: [BentoBox] DEBUG: CreatureSpawnEvent ZOMBIFIED_PIGLIN
[15:30:43 INFO]: [BentoBox] DEBUG: CreatureSpawnEvent result is (false = not allowed) : false

I am having trouble replicating the villager things because it's difficult to make the environment, but I'd like you to try and duplicate using this build (it has debug like above) and share, please.
Limits-1.21.0-SNAPSHOT-LOCAL.jar.zip

@tastybento tastybento added in progress being worked on and removed under investigation this is being looked into labels May 19, 2024
@Alasdairbugs
Copy link
Author

could not run this ver. on 1.20.4 - no errors came up, unsure what to do

@tastybento
Copy link
Member

Did you unzip it?

@Alasdairbugs
Copy link
Author

yep, a config was made and put into a data folder in the limits plugin folder,
bentobox > addons > limits > data > config.yml

running bsb 1.17.1 on mc v1.20.4

rebooting does not create a folder, making it ourselves doesnt help. its not recognising /bsbadmin limits

@Alasdairbugs
Copy link
Author

Figured it out, could not reproduce these fixes. I do however, see in the console that bbox notices and i get the same "[BentoBox] DEBUG: CreatureSpawnEvent result is (false = not allowed) : false" but to no avail, because the entities still persist over the limit without despawning.

  • same method as last time was used. pigs and villagers are still converted even if the limit is met. experiment was done on a deopped alt, too.

  • spawn eggs were used to spawn 2 zombie piglins to the limit, spawn eggs used to get 5 pigs. when struck by lightning from a channeling trident on a lightning rod, they converted.

  • same method for witches, except limit was 4 and 5 villagers were all converted.

just to be sure, i did a control: i bred 15 cows and none went over the limit, so the limits plugin was working where else intended. using version 1.20.4.

@tastybento
Copy link
Member

What is happening here then is that the Limits addon is canceling the event, but some other plugin's listener is allowing it again. Here's a version with the event priority changed from LOW to HIGHEST that may solve the problem. If you want to find out which plugin is doing this, then use the previous version and add plugins until you find the one that starts to cause the problem. I'm not familiar with all your plugins so I'm not sure which it may be, but you can start with ones that affect creature spawning.
Limits-1.21.0-SNAPSHOT-LOCAL.jar.zip

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

No branches or pull requests

2 participants