Skip to content

Intangible

Marker component that excludes an entity from collision detection. Stateless singleton.

// check if entity is intangible
boolean isIntangible = store.getComponent(ref, Intangible.getComponentType()) != null;
// or via archetype check (more efficient in systems)
boolean isIntangible = archetype.contains(Intangible.getComponentType());
// make entity intangible
store.ensureComponent(ref, Intangible.getComponentType());
// remove intangibility
store.tryRemoveComponent(ref, Intangible.getComponentType());

For entity holders:

Holder<EntityStore> holder = EntityStore.REGISTRY.newHolder();
holder.ensureComponent(Intangible.getComponentType());

The TangiableEntitySpatialSystem uses a query that excludes intangible entities:

Query<EntityStore> QUERY = Query.and(
TransformComponent.getComponentType(),
BoundingBox.getComponentType(),
Query.not(Intangible.getComponentType()) // excluded
);

This means intangible entities:

  • Are not in the collision spatial index
  • Cannot be hit by collision queries
  • Do not block player/entity movement

Additionally, DamageSystems.FilterUnkillable cancels damage to intangible entities.

Use CaseWhy Intangible
Warp markersVisual indicator, shouldn’t block movement
Parkour checkpointsDetection only, no physical presence
ProjectilesPrevents self-collision with launcher
Editor entitiesTool/debug entities hidden from gameplay
Visual effectsParticles, indicators that shouldn’t collide
// warp entities
holder.ensureComponent(Intangible.getComponentType());
// parkour checkpoints
holder.ensureComponent(Intangible.getComponentType());
// projectiles
holder.ensureComponent(Intangible.getComponentType());

The /entity intangible [--remove] command toggles intangibility on entities.

The component state is synced to clients via ComponentUpdateType.Intangible.

ComponentCollisionDamage
IntangibleNoBlocked
InvulnerableYesBlocked

Use Intangible for entities that should have no physical presence.

Use Invulnerable for entities that should still collide but not take damage.

Some entity types automatically receive Intangible via TangibleMigrationSystem. For example, entities with ProjectileComponent are auto-migrated to be intangible.