-
Bug
-
Resolution: Invalid
-
Minor
-
None
-
None
-
64bit Windows 10 development machine.
From /ver
[18:27:21 INFO]: This server is running CraftBukkit version git-Spigot-3fb9445-fbb47e8 (MC: 1.11.2) (Implementing API version 1.11.2-R0.1-SNAPSHOT)
[18:27:21 INFO]: Checking version, please wait...
[18:27:22 INFO]: You are running the latest version64bit Windows 10 development machine. From /ver [18:27:21 INFO] : This server is running CraftBukkit version git-Spigot-3fb9445-fbb47e8 (MC: 1.11.2) (Implementing API version 1.11.2-R0.1-SNAPSHOT) [18:27:21 INFO] : Checking version, please wait... [18:27:22 INFO] : You are running the latest version
-
Private plugin. Source located in main text.
When using this code to generate invisible armor stands (holograms), the hologram is initially created when the server is loaded (as the plugin is written in my code). Then a few seconds later the holograms will disappear.
/** * This will spawn an armor stand with a hologram type setup. * * @param name The name to display over the hologram. * @param location The location to spawn the hologram. * @return Returns the generated entity. */ private ArmorStand spawnArmorStand(String name, Location location) { String worldName = location.getWorld().getName(); ArmorStand stand = (ArmorStand) Bukkit.getWorld(worldName).spawnEntity(location, EntityType.ARMOR_STAND); //Setup armor stand. stand.setSmall(true); stand.setBasePlate(false); stand.setCanPickupItems(false); stand.setCollidable(false); stand.setGravity(false); stand.setInvulnerable(true); stand.setVisible(false); stand.setRemoveWhenFarAway(false); //Set the armor stands name. stand.setCustomName(color(name)); stand.setCustomNameVisible(true); return stand; }
I wrote some additional code to test what was going on with the holograms. The picture below shows when the holograms are initially created and set inside the world. Then less than one minute later (or when you move/teleport away) from them, they will unload. I have gone into GameMode 3 to check for their existence before and after.
The holograms that stay loaded are the ones within the world spawn region (the protected region upon vanilla server startup).
So, I think their may be a bug with the method setRemoveWhenFarAway(*false)* not working correctly. According to the API, all living entities implement this interface. ArmorStand implements this interface.
Thank you for your time!
More reading:
Original problem stated here: https://www.spigotmc.org/threads/armorstand-hologram-disappearing-setremovewhenfaraway-false-not-working.237315/