Class NPCFlockCommand


public class NPCFlockCommand extends AbstractCommandCollection
A command collection for managing NPC flocks.
  • Constructor Details

    • NPCFlockCommand

      public NPCFlockCommand()
      Default Constructor for an NPCFlockCommand instance.
  • Method Details

    • forNpcEntitiesInViewCone

      public static int forNpcEntitiesInViewCone(@Nonnull Ref<EntityStore> playerReference, @Nonnull Store<EntityStore> store, @Nonnull BiPredicate<Ref<EntityStore>, NPCEntity> predicate)
      Iterates through NPCs in the player's view cone and applies a predicate to each.
      Parameters:
      playerReference - The player's entity reference.
      store - The entity store.
      predicate - The predicate to test on each NPC.
      Returns:
      the number of NPCs that matched the predicate.
    • anyEntityInViewCone

      public static boolean anyEntityInViewCone(@Nonnull Ref<EntityStore> playerReference, @Nonnull Store<EntityStore> store, @Nonnull Predicate<Ref<EntityStore>> predicate)
      Checks if any entity in the player's view cone satisfies the given predicate.
      Parameters:
      playerReference - The entity reference of the player entity.
      store - The entity store for component access.
      predicate - The predicate to test entities against.
      Returns:
      true if any entity satisfies the predicate, false otherwise.