Class Spectating

java.lang.Object
com.hypixel.hytale.server.core.modules.entity.component.Spectating
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class Spectating extends Object implements Component<EntityStore>
Marks a player entity as spectating, and which entity it is watching through the follow camera. Session-only and never persisted.

Spectator behavior (visibility, NPC detection, item pickup, camera) keys on this component. Entering a gamemode type with Spectator: true composes the full spectator state.

Immutable: watching a target or returning to free-fly means putting a new instance, and the spectator systems compose the camera from the change.

  • Constructor Details

    • Spectating

      public Spectating()
      Creates a free-flying spectating state with no watched target.
    • Spectating

      public Spectating(@Nullable Ref<EntityStore> targetRef)
      Creates a spectating state watching the given target through the follow camera.
      Parameters:
      targetRef - The entity reference to watch, or null for free-fly.
  • Method Details