kangarko / Boss

Premium custom monsters plugin with skill system, natural spawning and lots of sickest features!
https://www.mc-market.org/resources/21619/
77 stars 28 forks source link

1.20.4 - Bosses Not Respecting Limits In Unloaded Chunks #1249

Closed JerichoTorrent closed 3 months ago

JerichoTorrent commented 3 months ago

I set it so bosses don't have to be within 30 blocks of the player, and instead can spawn in unloaded chunks. This is because I have some bosses that are meant to spawn once daily, or once an hour. The chances of the player being near the boss when it's supposed to spawn is low, and I want to INSPIRE players to go fight the boss by announcing it in chat.

The problem is, with this configuration, the bosses ignore my limits that I placed on them. Is this a Minecraft limitation, or can this be fixed? It's almost as if Boss doesn't know that the boss has already spawned, because it can't detect it in an unloaded chunk.

Boss-2024-05-23T013235Z.tar.gz.

JerichoTorrent commented 3 months ago

I also have found another 2 bugs regarding Citizens. Figured I would put it in here rather than making a new issue.

  1. Bosses will not keep the Citizen's skin when they respawn. Applying a skin from skindex, whether through the boss menu or /npc skin --url , the boss will keep the skin until he dies, then lose it and throw an error in console asking if the url is a real skin.
  2. Bosses seem to get weird when using Citizens hook regarding their movement speed. It seems by setting a Boss to use Citizens they instantly get super fast, so I have to slow them down by using /npc speed , which then instantly makes them super slow even if I barely change their speed. It's difficult to find a good balance here, and again they seem to break this mechanic when they respawn and they just get super fast again. Not sure the best way to go about setting their speed since the respawning mechanic seems to break certain Boss features if the boss is a citizen.

I tried asking in the Citizens discord and didn't get much help.

kangarko commented 3 months ago

Hey and thanks for waiting while we were on holidays!

  1. I just tried to add a system to count unloaded bosses but there is a bukkit/spigot/paper bug at least on 1.20.6 where the unloaded chunk always reports 0 entities in it: https://i.imgur.com/QNaJCmT.png Unfortunately there is no other event called to help us with that.

  2. Please post that error.

  3. I apology, there is a known bug in some cases, that seems to be a limitation with citizens API. We do have a newly added setting for boss speed, did you use it instead of /npc speed? I believe its either in attributes or citizens menu,.

JerichoTorrent commented 3 months ago

I just tried to add a system to count unloaded bosses but there is a bukkit/spigot/paper bug at least on 1.20.6 where the unloaded chunk always reports 0 entities in it: https://i.imgur.com/QNaJCmT.png Unfortunately there is no other event called to help us with that.

I found somewhat of a workaround. I made a WorldGuard region around where the bosses spawn that I need to respect my limits and spawn when and where I need them too. Then I set the region flag to deny chunk unloading. So the chunks always stay loaded, which is not good for performance but at least fixes the issue for now. Hopefully someday an event exists that can be called, but who knows at this point.

image_2024-05-29_125212411 Here is the error I was referring to. I know the skin is valid, because when I change the skin with /npc skin --url <link> it works fine, but upon killing and respawning the boss, it breaks.

I apology, there is a known bug in some cases, that seems to be a limitation with citizens API. We do have a newly added setting for boss speed, did you use it instead of /npc speed? I believe its either in attributes or citizens menu.

I have found that setting in /boss menu -> citizens -> speed, and it seems to have fixed the issue. Thank you.

Strangely, after tweaking the Citizens speed, I killed and respawned the bosses just now and the skins appear to be working. Not sure how I could've fixed it by just adjusting the speed. For that reason I'm sure the issue could crop up again, as I'm not sure how those two things are related. Just thought you should be aware.

kangarko commented 3 months ago

Thanks for posting and sorry for the delay. Let me know if it crops up again.