Skip to content

몹이 숨김처리가 되어도 여전히 체력바 보임 #19

Description

@crston

Required
I need some help to provide you correct solution.
@eventhandler(ignoreCancelled = true)
public void onMythicMobSpawn(MythicMobSpawnEvent event) {
Location location = event.getLocation();
World world = location.getWorld();
MythicMob mob = event.getMob().getType();

    if (world == null || !privateMobIds.contains(mob.getInternalName()) || !allowedWorlds.contains(world.getName())) return;

    Player owner = getNearestPlayer(location, 10);
    if (owner == null) return;

    Entity entity = event.getMob().getEntity().getBukkitEntity();
    UUID entityId = entity.getUniqueId();
    UUID playerId = owner.getUniqueId();
    mobOwnerMap.put(entityId, playerId);

    // Hide from other players after 1 tick
    Bukkit.getScheduler().runTaskLater(this, () -> {
        for (Player other : Bukkit.getOnlinePlayers()) {
            if (!other.getUniqueId().equals(playerId)) {
                other.hideEntity(this, entity);
            }
        }
    }, 1L);
}

여전히 다른 몬스터에겐 투명하게 보이는데 그 투명한 몬스터의 체력바가 보임

  1. Tell me the detail about your problem.

  2. Upload some screenshot or text log related your issue. such as:

  • Error log
  • In-game screen
  • Your yml config
  • Your resource
  1. Remember to notice your environment
  • OS(windows/mac/etc)
  • Server version(1.21.1/etc)
  • Server platform(spigot/paper/folia/fabric/etc)

Disclaimer
I do NOT provide any solution about that.

  • Using informal launcher such as Feather client
  • Closed-source plugin/mod such as Optifine and ItemsAdder
  • Usage in hybrid bukkit such as ArcLight

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingquestionFurther information is requested

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions