Skip to content

Conversation

@TheosRee
Copy link
Contributor

@TheosRee TheosRee commented Nov 21, 2025

📋 Description

Currently it is not possible to continiously hide a Npc from the core Registry to a player.
Even when setting the visibility through the existent map it is only an indicator if the Npc should be re-spawned on the next iteration of the core loop.
That means even when cancelling the NpcSpawn event the whole check logic will be done first, resulting first in unnecessary "work" (which can be ignored when it is async anyways) but more important is annoying to achieve.

I don't exactly know if it will resolved but with the method of hiding through cancelling the NpcSpawn event I get that issue: BetonQuest/BetonQuest#3540

✅ Checklist

  • My code follows the project's coding style and guidelines
  • I have tested my changes locally and they work as expected
  • I have added necessary documentation (if applicable)
  • I have linked related issues using Fixes #issue_number or Closes #issue_number
  • I have rebased/merged with the latest main branch

🔍 Changes

I've added the map to just skip the spawn process in the abstract Npc.
I also removed the setting of default values on Player join and replaced the re-setting to default on log out.
I doubt it will make a performance difference but it is "just better".


🧪 How to Test

Please describe how to manually test the changes made in this PR.

  1. Make a test plugin which adds the UUID with the value true to the map
  2. ...
  3. Enjoy not having to cancel the event every tick

@TheosRee TheosRee marked this pull request as draft November 21, 2025 18:53
@TheosRee TheosRee marked this pull request as ready for review November 21, 2025 19:59
@TheosRee
Copy link
Contributor Author

The mentioned bug is not fixed.
I don't know if there should also be a command to hide them, when necessary I could try to add one.

until now you need to cancel the NpcSpawnEvent but that is called relative late in the spawn process of a Npc
…t to default value

also don't set the default value on Join
remove code comments in favor of JDoc for method
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

Successfully merging this pull request may close these issues.

1 participant