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.Dynamic3CommandExceptionType
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType
private static final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
addModifier
(CommandSourceStack source, Entity entity, Holder<Attribute> attribute, ResourceLocation id, double amount, AttributeModifier.Operation operation) private static int
getAttributeBase
(CommandSourceStack source, Entity entity, Holder<Attribute> attribute, double scale) private static Component
getAttributeDescription
(Holder<Attribute> attribute) private static AttributeInstance
getAttributeInstance
(Entity entity, Holder<Attribute> attribute) private static int
getAttributeModifier
(CommandSourceStack source, Entity entity, Holder<Attribute> attribute, ResourceLocation id, double scale) private static int
getAttributeValue
(CommandSourceStack source, Entity entity, Holder<Attribute> attribute, double scale) private static LivingEntity
getEntityWithAttribute
(Entity entity, Holder<Attribute> attribute) private static LivingEntity
getLivingEntity
(Entity target) static void
register
(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) private static int
removeModifier
(CommandSourceStack source, Entity entity, Holder<Attribute> attribute, ResourceLocation id) private static int
setAttributeBase
(CommandSourceStack source, Entity entity, Holder<Attribute> attribute, double value)
-
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> dispatcher, CommandBuildContext context) -
getAttributeInstance
private static AttributeInstance getAttributeInstance(Entity entity, Holder<Attribute> attribute) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getLivingEntity
private static LivingEntity getLivingEntity(Entity target) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getEntityWithAttribute
private static LivingEntity getEntityWithAttribute(Entity entity, Holder<Attribute> attribute) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getAttributeValue
private static int getAttributeValue(CommandSourceStack source, Entity entity, Holder<Attribute> attribute, double scale) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getAttributeBase
private static int getAttributeBase(CommandSourceStack source, Entity entity, Holder<Attribute> attribute, double scale) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getAttributeModifier
private static int getAttributeModifier(CommandSourceStack source, Entity entity, Holder<Attribute> attribute, ResourceLocation id, double scale) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
setAttributeBase
private static int setAttributeBase(CommandSourceStack source, Entity entity, Holder<Attribute> attribute, double value) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
addModifier
private static int addModifier(CommandSourceStack source, Entity entity, Holder<Attribute> attribute, ResourceLocation id, double amount, AttributeModifier.Operation operation) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
removeModifier
private static int removeModifier(CommandSourceStack source, Entity entity, Holder<Attribute> attribute, ResourceLocation id) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getAttributeDescription
-