Record Class EntityItemAccessor
java.lang.Object
java.lang.Record
net.minecraft.server.commands.item.EntityItemAccessor
- All Implemented Interfaces:
ItemAccessor<Entity>
public record EntityItemAccessor(Collection<? extends Entity> entities)
extends Record
implements ItemAccessor<Entity>
-
Nested Class Summary
Nested classes/interfaces inherited from interface ItemAccessor
ItemAccessor.SetterFunction<Target> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Collection<? extends Entity> The field for theentitiesrecord component.static final ArgProvider.Factory<ItemAccessor<?>> private static final CommandResponseTracker.Messages<Entity> private static final CommandResponseTracker.Messages<Entity> private static final CommandResponseTracker.MessagesWithArg<Entity, ItemStack> -
Constructor Summary
ConstructorsConstructorDescriptionEntityItemAccessor(Collection<? extends Entity> entities) Creates an instance of aEntityItemAccessorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends Entity> entities()Returns the value of theentitiesrecord component.final booleanIndicates whether some other object is "equal to" this one.intgetModifySuccess(CommandSourceStack source, CommandResponseTracker<Entity> tracker) intgetReplaceSuccess(CommandSourceStack source, CommandResponseTracker<Entity> tracker, @Nullable ItemStack knownItem) getSlots(CommandSourceStack source, SlotSource slotSource) final inthashCode()Returns a hash code value for this object.voidsetItems(CommandSourceStack source, SlotSource slotSource, ItemAccessor.SetterFunction<Entity> function) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
entities
The field for theentitiesrecord component. -
PROVIDER
-
RESPONSE_SET
-
RESPONSE_SET_KNOWN_ITEM
private static final CommandResponseTracker.MessagesWithArg<Entity, ItemStack> RESPONSE_SET_KNOWN_ITEM -
RESPONSE_MODIFY
-
-
Constructor Details
-
EntityItemAccessor
Creates an instance of aEntityItemAccessorrecord class.- Parameters:
entities- the value for theentitiesrecord component
-
-
Method Details
-
getSlots
- Specified by:
getSlotsin interfaceItemAccessor<Entity>
-
setItems
public void setItems(CommandSourceStack source, SlotSource slotSource, ItemAccessor.SetterFunction<Entity> function) - Specified by:
setItemsin interfaceItemAccessor<Entity>
-
getReplaceSuccess
public int getReplaceSuccess(CommandSourceStack source, CommandResponseTracker<Entity> tracker, @Nullable ItemStack knownItem) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
getReplaceSuccessin interfaceItemAccessor<Entity>- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getModifySuccess
public int getModifySuccess(CommandSourceStack source, CommandResponseTracker<Entity> tracker) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
getModifySuccessin interfaceItemAccessor<Entity>- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
entities
Returns the value of theentitiesrecord component.- Returns:
- the value of the
entitiesrecord component
-