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 enum
static enum
static enum
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfind
(CommandSender sender) Find a list of entities (could be empty) based on the conditions@Nullable Entity
findFirstEntity
(CommandSender sender) @Nullable Entity
findFirstEntity
(@Nullable Instance instance, @Nullable Entity self) @Nullable Player
findFirstPlayer
(CommandSender sender) @Nullable Player
findFirstPlayer
(@Nullable Instance instance, @Nullable Entity self) Shortcut offind(Instance, Entity)
to retrieve the first player element in the list.setConstantName
(String constantName) setConstantUuid
(UUID constantUuid) setDifference
(float dx, float dy, float dz) setDistance
(Range.Int distance) setEntity
(EntityType entityType, EntityFinder.ToggleableType toggleableType) setEntitySort
(EntityFinder.EntitySort entitySort) setGameMode
(GameMode gameMode, EntityFinder.ToggleableType toggleableType) setLimit
(int limit) setName
(String name, EntityFinder.ToggleableType toggleableType) setStartPosition
(Point startPosition) setTargetSelector
(EntityFinder.TargetSelector targetSelector) setUuid
(UUID uuid, EntityFinder.ToggleableType toggleableType)
-
Constructor Details
-
EntityFinder
public EntityFinder()
-
-
Method Details
-
setTargetSelector
-
setEntitySort
-
setStartPosition
-
setDistance
-
setLimit
-
setLevel
-
setEntity
-
setConstantName
-
setConstantUuid
-
setName
-
setUuid
-
setGameMode
-
setDifference
-
find
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
-