Package dev.latvian.mods.kubejs.player
Class EntityArrayList
java.lang.Object
java.util.AbstractCollection<net.minecraft.world.entity.Entity>
java.util.AbstractList<net.minecraft.world.entity.Entity>
java.util.ArrayList<net.minecraft.world.entity.Entity>
dev.latvian.mods.kubejs.player.EntityArrayList
- All Implemented Interfaces:
DataSenderKJS,MessageSenderKJS,Serializable,Cloneable,Iterable<net.minecraft.world.entity.Entity>,Collection<net.minecraft.world.entity.Entity>,List<net.minecraft.world.entity.Entity>,RandomAccess,SequencedCollection<net.minecraft.world.entity.Entity>
@RemapPrefixForJS("kjs$")
public class EntityArrayList
extends ArrayList<net.minecraft.world.entity.Entity>
implements MessageSenderKJS, DataSenderKJS
- See Also:
-
Field Summary
FieldsFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionEntityArrayList(int size) EntityArrayList(Iterable<? extends net.minecraft.world.entity.Entity> entities) EntityArrayList(net.minecraft.world.level.Level level, Iterable<? extends net.minecraft.world.entity.Entity> entities) Deprecated, for removal: This API element is subject to removal in a future version.polyfill for when EntityArrayList needed a Level, will be removed in a future version! -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllIterable(Iterable<? extends net.minecraft.world.entity.Entity> entities) filterDistance(double x, double y, double z, double distance) filterDistance(net.minecraft.core.BlockPos pos, double distance) filterList(List<Predicate<net.minecraft.world.entity.Entity>> filterList) filterSelector(net.minecraft.commands.arguments.selector.EntitySelector selector) filterType(net.minecraft.world.entity.EntityType<?> type) @Nullable net.minecraft.world.entity.EntitygetFirst()voidkill()net.minecraft.network.chat.Componentnet.minecraft.network.chat.Componentvoidkjs$runCommand(String command) voidkjs$runCommandSilent(String command) voidkjs$sendData(String channel, @Nullable net.minecraft.nbt.CompoundTag data) voidkjs$setActivePostShader(@Nullable net.minecraft.resources.ResourceLocation id) voidkjs$setStatusMessage(net.minecraft.network.chat.Component message) voidkjs$tell(net.minecraft.network.chat.Component message) voidplaySound(net.minecraft.sounds.SoundEvent id) voidplaySound(net.minecraft.sounds.SoundEvent id, float volume, float pitch) Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface dev.latvian.mods.kubejs.core.DataSenderKJS
kjs$sendDataMethods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
ALWAYS_TRUE_PREDICATE
-
-
Constructor Details
-
EntityArrayList
public EntityArrayList(int size) -
EntityArrayList
-
EntityArrayList
@Deprecated(forRemoval=true, since="7.2") public EntityArrayList(net.minecraft.world.level.Level level, Iterable<? extends net.minecraft.world.entity.Entity> entities) Deprecated, for removal: This API element is subject to removal in a future version.polyfill for when EntityArrayList needed a Level, will be removed in a future version!
-
-
Method Details
-
addAllIterable
-
kjs$getName
public net.minecraft.network.chat.Component kjs$getName()- Specified by:
kjs$getNamein interfaceMessageSenderKJS
-
kjs$getDisplayName
public net.minecraft.network.chat.Component kjs$getDisplayName()- Specified by:
kjs$getDisplayNamein interfaceMessageSenderKJS
-
kjs$tell
@Info(value="Sends a message in chat to every entity in the list.", params=@Param(name="message",value="A text component. It may be a string, which will be implicitly wrapped into a text component.")) public void kjs$tell(net.minecraft.network.chat.Component message) - Specified by:
kjs$tellin interfaceMessageSenderKJS
-
kjs$setStatusMessage
public void kjs$setStatusMessage(net.minecraft.network.chat.Component message) - Specified by:
kjs$setStatusMessagein interfaceMessageSenderKJS
-
kjs$runCommand
@Info(value="Each entity in the list runs the specified console command with their permission level.", params=@Param(name="command",value="The console command. Slash at the beginning is optional.")) public void kjs$runCommand(String command) - Specified by:
kjs$runCommandin interfaceMessageSenderKJS
-
kjs$runCommandSilent
@Info(value="Each entity in the list runs the specified console command with their permission level. The command won\'t output any logs in chat nor console", params=@Param(name="command",value="The console command. Slash at the beginning is optional.")) public void kjs$runCommandSilent(String command) - Specified by:
kjs$runCommandSilentin interfaceMessageSenderKJS
-
kjs$setActivePostShader
public void kjs$setActivePostShader(@Nullable @Nullable net.minecraft.resources.ResourceLocation id) - Specified by:
kjs$setActivePostShaderin interfaceMessageSenderKJS
-
kill
-
playSound
@Info("Plays a sound from each entity in the list, unless the entity is silent.") public void playSound(net.minecraft.sounds.SoundEvent id, float volume, float pitch) -
playSound
@Info("Plays a sound from each entity in the list, unless the entity is silent.") public void playSound(net.minecraft.sounds.SoundEvent id) -
filter
@Info(value="Filters the entity list by passing each entity through a given predicate.\nEntities that pass the predicate will end up in the resulting entity list.\n", params=@Param(name="filter",value="The predicate - a function that takes an argument of `Entity` and returns a boolean.")) public EntityArrayList filter(Predicate<net.minecraft.world.entity.Entity> filter) -
filterList
@Info(value="Filters the entity list by passing each entity through all predicates in provided list.\nEntities that pass at least one of the predicates will end up in the resulting entity list.\n", params=@Param(name="filterList",value="The list of predicates - functions that take one argument of `Entity` and return boolean values.")) public EntityArrayList filterList(List<Predicate<net.minecraft.world.entity.Entity>> filterList) -
filterSelector
@Info(value="Filters the entity list based on the provided `EntitySelector`.", params=@Param(name="selector",value="The entity selector. It may be a string representing the entity selector as seen in commands, such as `\'@e[distance=..25]\'`")) public EntityArrayList filterSelector(net.minecraft.commands.arguments.selector.EntitySelector selector) -
filterDistance
@Info(value="Filters the entity list based on distance to the given point.\nEntities that are closer than `distance` away from the point specified by `x`, `y` and `z` coordinates will end up in the resulting list.\n",params={@Param(name="x",value="The `x` coordinate of the point."),@Param(name="y",value="The `y` coordinate of the point."),@Param(name="z",value="The `z` coordinate of the point."),@Param(name="distance",value="The maximum distance of entities from the point.")}) public EntityArrayList filterDistance(double x, double y, double z, double distance) -
filterDistance
@Info(value="Filters the entity list based on distance to the given block position.\nEntities that are closer than `distance` away from the center of the block will end up in the resulting list.\n",params={@Param(name="pos",value="The `BlockPos` - that is the center of the block at specified position. It can be a 3-element array of integers, such as `[64, 25, 39]`."),@Param(name="distance",value="The maximum distance of entities from the point.")}) public EntityArrayList filterDistance(net.minecraft.core.BlockPos pos, double distance) -
filterPlayers
-
filterItems
@Info("Results in an entity list containing only item entities.") public EntityArrayList filterItems() -
filterType
@Info(value="Filters the entity list based on the type of the entity. Only entities whose type is equal to the provided one will end up in the resulting list.", params=@Param(name="type",value="The entity type. It may be a string representing an entity ID, like `\'minecraft:creeper\'`.")) public EntityArrayList filterType(net.minecraft.world.entity.EntityType<?> type) -
kjs$sendData
@Info(value="Sends NBT data to every player in the list.",params={@Param(name="channel",value="String. Represents the network channel."),@Param(name="data",value="The NBT compound tag containing data to send. May be `null`.\nIt may be a JS object containing data or string representing stringified NBT.\n")}) public void kjs$sendData(String channel, @Nullable @Nullable net.minecraft.nbt.CompoundTag data) - Specified by:
kjs$sendDatain interfaceDataSenderKJS
-
getFirst
@Nullable @Info("Gets the first entity on the list, or `null` if the list is empty.") public @Nullable net.minecraft.world.entity.Entity getFirst()
-