Package net.minestom.server.utils.entity
Class EntityFinder
java.lang.Object
net.minestom.server.utils.entity.EntityFinder
Represents a query which can be call to find one or multiple entities.
It is based on the target selectors used in commands.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfind(@NotNull CommandSender sender) Find a list of entities (could be empty) based on the conditions@Nullable EntityfindFirstEntity(@NotNull CommandSender sender) @Nullable EntityfindFirstEntity(@Nullable Instance instance, @Nullable Entity self) @Nullable PlayerfindFirstPlayer(@NotNull CommandSender sender) @Nullable PlayerfindFirstPlayer(@Nullable Instance instance, @Nullable Entity self) Shortcut offind(Instance, Entity)to retrieve the first player element in the list.setConstantName(@NotNull String constantName) setConstantUuid(@NotNull UUID constantUuid) setDifference(float dx, float dy, float dz) setDistance(@NotNull IntRange distance) setEntity(@NotNull EntityType entityType, @NotNull EntityFinder.ToggleableType toggleableType) setEntitySort(@NotNull EntityFinder.EntitySort entitySort) setGameMode(@NotNull GameMode gameMode, @NotNull EntityFinder.ToggleableType toggleableType) setLimit(int limit) setName(@NotNull String name, @NotNull EntityFinder.ToggleableType toggleableType) setStartPosition(@NotNull Point startPosition) setTargetSelector(@NotNull EntityFinder.TargetSelector targetSelector) setUuid(@NotNull UUID uuid, @NotNull EntityFinder.ToggleableType toggleableType)
-
Constructor Details
-
EntityFinder
public EntityFinder()
-
-
Method Details
-
setTargetSelector
-
setEntitySort
-
setStartPosition
-
setDistance
-
setLimit
-
setLevel
-
setEntity
public EntityFinder setEntity(@NotNull @NotNull EntityType entityType, @NotNull @NotNull EntityFinder.ToggleableType toggleableType) -
setConstantName
-
setConstantUuid
-
setName
public EntityFinder setName(@NotNull @NotNull String name, @NotNull @NotNull EntityFinder.ToggleableType toggleableType) -
setUuid
public EntityFinder setUuid(@NotNull @NotNull UUID uuid, @NotNull @NotNull EntityFinder.ToggleableType toggleableType) -
setGameMode
public EntityFinder setGameMode(@NotNull @NotNull GameMode gameMode, @NotNull @NotNull EntityFinder.ToggleableType toggleableType) -
setDifference
-
find
@NotNull public @NotNull List<@NotNull Entity> find(@Nullable @Nullable Instance instance, @Nullable @Nullable Entity self) Find a list of entities (could be empty) based on the conditions- Parameters:
instance- the instance to search from, null if the query can be executed using global data (all online players)self- the source of the query, null if not any- Returns:
- all entities validating the conditions, can be empty
-
find
-
findFirstPlayer
@Nullable public @Nullable Player findFirstPlayer(@Nullable @Nullable Instance instance, @Nullable @Nullable Entity self) Shortcut offind(Instance, Entity)to retrieve the first player element in the list.- Returns:
- the first player returned by
find(Instance, Entity) - See Also:
-
findFirstPlayer
-
findFirstEntity
-
findFirstEntity
-