HomeBedrockAddonsEntity Culling MCBE
Entity Culling MCBE
AddonsBedrock

Entity Culling MCBE

A multiplayer/realms friendly addon for MCBE that despawns mobs no player can currently see (out of FOV *and* behind a block) and restores them once a…

⬇ Download on CurseForge
Entity Culling MCBE — screenshot 1

A addon for MCBE that despawns mobs no player can currently see (out
of FOV *and* behind a block) and restores them - position, rotation, health,
name tag - once a player can see that spot again. This is the same idea as
client-side "Entity Culling" mods, reimplemented server-side with the
`@minecraft/server` scripting API, since Bedrock add-ons can't hook the
renderer directly.

Built against **Minecraft Bedrock 1.26.40**, using `@minecraft/server` v2.9.0
(stable - no experimental/cheats toggles required).

📝How it works:

1. Every few ticks, each player's nearby entities are scanned
2. Entities are filtered down to ones that are safe to touch: no players,
   no bosses, no villagers/traders, no leashed/ridden/inventoried mobs, and
   (by default) no custom-named entities.
3. For each remaining candidate, we check whether *any* player can see it
   ('fov.js' for the view-cone test, `raycast.js` for the block-occlusion
   test). An entity only counts as hidden if nobody can see it - this is
   deliberately multiplayer-safe.
4. If an entity stays hidden for `cullDelayTicks` in a row (default 15
   ticks, ~0.75s), its state is captured (`entityState.js`) into a small
   persistent database (`database.js`, stored in world dynamic properties)
   and the real entity is removed (`culling.js`).
5. On a second timer, every culled record is checked against current
   player visibility. The moment a player could see that spot again, a
   fresh entity is `/summon`-ed there and the saved state is reapplied
   (`restore.js`).
6. `main.js` just wires all of the above together and registers the
   `/cull:*` commands (`commands.js`).

Architecture:

                    ┌─────────────────────┐
                    │     Player(s)       │
                    └──────────┬──────────┘
                               │
                         every 2–5 ticks
                               │
                               ▼
                  ┌────────────────────────┐
                  │   Entity Scanner        │
                  │ nearby entities         │
                  └───────────┬────────────┘
                              │
                    ┌─────────▼─────────┐
                    │     FOV Check      │
                    │ Is entity inside   │
                    │ player's FOV?      │
                    └───────┬─────┬──────┘
                            │YES  │NO
                            │     │
                     keep it     ▼
                         ┌───────────────┐
                         │ Block Raycast │
                         │ Is wall in    │
                         │ front of mob? │
                         └───────┬───────┘
                                 │
                         ┌───────┴────────┐
                         │                │
                       NO wall          WALL
                         │                │
                      keep mob       SAVE STATE
                                          │
                                          ▼
                                    DESPAWN MOB
                                          │
                                          ▼
                                  Culling Database
                                          │
                            player looks toward area
                                          │
                                          ▼
                                   RESTORE ENTITY
                                          │
                                          ▼
                                      /summon

📝Commands (optional):

All of these require operator permission and cheats enabled:

| Command | Effect |
|---|---|
| `/cull:on` | Enable the system |
| `/cull:off` | Disable it and immediately restore everything currently culled |
| `/cull:debug` | Toggle chat messages on every cull/restore |
| `/cull:stats` | Show how many entities are currently culled |
| `/cull:distance <blocks>` | Set scan/restore range (8-128) |
| `/cull:fov <degrees>` | Set the view-cone angle (30-180) |
| `/cull:reload` | Reset all settings to defaults |
| `/cull:help` | List these commands in-game |

This was inspired by tr7zw's Entity Culling mod <3.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more