Package net.minecraft.server.commands
Class AttributeCommand
java.lang.Object
net.minecraft.server.commands.AttributeCommand
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intaddModifier(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute, ResourceLocation pId, double pAmount, AttributeModifier.Operation pOperation) private static intgetAttributeBase(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute, double pScale) private static ComponentgetAttributeDescription(Holder<Attribute> pAttribute) private static AttributeInstancegetAttributeInstance(Entity pEntity, Holder<Attribute> pAttribute) private static intgetAttributeModifier(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute, ResourceLocation pId, double pScale) private static Stream<ResourceLocation> getAttributeModifiers(Entity pEntity, Holder<Attribute> pAttribute) private static intgetAttributeValue(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute, double pScale) private static LivingEntitygetEntityWithAttribute(Entity pEntity, Holder<Attribute> pAttribute) private static LivingEntitygetLivingEntity(Entity pTarget) static voidregister(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> pDispatcher, CommandBuildContext pContext) private static intremoveModifier(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute, ResourceLocation pId) private static intresetAttributeBase(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute) private static intsetAttributeBase(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute, double pValue)
-
Field Details
-
ERROR_NOT_LIVING_ENTITY
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_NOT_LIVING_ENTITY -
ERROR_NO_SUCH_ATTRIBUTE
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_NO_SUCH_ATTRIBUTE -
ERROR_NO_SUCH_MODIFIER
private static final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType ERROR_NO_SUCH_MODIFIER -
ERROR_MODIFIER_ALREADY_PRESENT
private static final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType ERROR_MODIFIER_ALREADY_PRESENT
-
-
Constructor Details
-
AttributeCommand
public AttributeCommand()
-
-
Method Details
-
register
public static void register(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> pDispatcher, CommandBuildContext pContext) -
getAttributeInstance
private static AttributeInstance getAttributeInstance(Entity pEntity, Holder<Attribute> pAttribute) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getLivingEntity
private static LivingEntity getLivingEntity(Entity pTarget) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getEntityWithAttribute
private static LivingEntity getEntityWithAttribute(Entity pEntity, Holder<Attribute> pAttribute) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getAttributeValue
private static int getAttributeValue(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute, double pScale) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getAttributeBase
private static int getAttributeBase(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute, double pScale) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getAttributeModifier
private static int getAttributeModifier(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute, ResourceLocation pId, double pScale) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getAttributeModifiers
private static Stream<ResourceLocation> getAttributeModifiers(Entity pEntity, Holder<Attribute> pAttribute) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
setAttributeBase
private static int setAttributeBase(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute, double pValue) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
resetAttributeBase
private static int resetAttributeBase(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
addModifier
private static int addModifier(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute, ResourceLocation pId, double pAmount, AttributeModifier.Operation pOperation) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
removeModifier
private static int removeModifier(CommandSourceStack pSource, Entity pEntity, Holder<Attribute> pAttribute, ResourceLocation pId) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getAttributeDescription
-