Skip to content

getEntities does not return all loaded entities #14330

Closed

Description

@Bobcat00

Expected behavior

world.getEntities() should return all loaded entities.

Observed/Actual behavior

world.getEntities() does not return certain armor stands placed in creative mode. Following is the data from the entities .mca file of such an armor stand.

Image

Steps/models to reproduce

The easiest may is to use Spark's entities screen to see how many entities are loaded. Place several dozen of the above armor stands, then use Spark to see how many armor stands Paper is reporting. You could also write a plugin to call getEntities() and log what Paper returns.

Plugin and Datapack List

15:42:27 [INFO] Server Plugins (30):
15:42:27 [INFO] Bukkit Plugins:
15:42:27 [INFO] - AltDetector, BetterSeen, BlueMap, BlueMapFilteredEntities, BookExploitFix, Essentials, EssentialsChat, EssentialsGeoIP, EssentialsSpawn, FastAsyncWorldEdit
15:42:27 [INFO] ImageMaps, IronDoors, LimitDrops, LuckPerms, MemCheck, NBTAPI, PlaytimeScoreboard, PlotMarkers, PlotSquared, PlotWelcome
15:42:27 [INFO] prism, PwnFilter, TabListPing, Vault, ViaBackwards, ViaVersion, ViaVersionStatus, WallClock, WorldEditSelectionVisualizer, WorldGuard

Paper version

15:43:07 [INFO] Checking version, please wait...
15:43:08 [INFO] This server is running Paper version 26.3-141-main@54024d3 (2026-10-01T15:55:33Z) (Implementing API version 26.3.build.141-beta)
You are running the latest version
Previous version: 26.3-140-977da0d (MC: 26.3)

Other

There are no errors in the log file. I also see this problem with Paper 26.2

Activity

  1. added theissue type on Oct 1, 2026
  2. Hexay commented on Oct 1, 2026

    @Hexay

    Zero-health stands are skipped by getEntities. If you give the entity it's health back it will return.

  3. JavierFlores09 commented on Oct 2, 2026

    @JavierFlores09
    Contributor

    I mentioned this on discord, but I don't believe World#getEntities (or any other entity list getter for that matter) should return effectively non-existent entities. Mostly because it would break already existing plugins not filtering for invalid entities if one were to change this now, but also because the only reason those entities exist to begin with is due to a bug with the non-ticking armor stands feature. I made a PR for that specific case.

    In short, this should never happen and if it does it is because of a bug, not because getEntities should be counting invalid entities.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    MC Issue

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions