Interface IManaHelper
public interface IManaHelper
Interface for mana related helper methods.
-
Method Summary
Modifier and TypeMethodDescriptionbooleandecreaseMana(net.minecraft.world.entity.LivingEntity entity, float amount) Decreases the mana value of the given entity.booleandecreaseMana(net.minecraft.world.entity.LivingEntity entity, float mana, boolean force) Decreases the mana value of the given entity.floatgetMana(net.minecraft.world.entity.LivingEntity entity) floatgetMaxMana(net.minecraft.world.entity.LivingEntity entity) booleanincreaseMana(net.minecraft.world.entity.LivingEntity entity, float amount) Increases the mana value of the given entity.booleansetMana(net.minecraft.world.entity.LivingEntity entity, float amount) Sets the mana value of the given entity.
-
Method Details
-
getMana
float getMana(net.minecraft.world.entity.LivingEntity entity) - Parameters:
entity- The entity to get the mana value for.- Returns:
- The mana value of the entity, or 0 if the entity does not have a mana capability.
-
getMaxMana
float getMaxMana(net.minecraft.world.entity.LivingEntity entity) - Parameters:
entity- The entity to get the maximum mana value for.- Returns:
- The maximum mana value of the entity, or 0 if the entity does not have a max mana value.
-
increaseMana
boolean increaseMana(net.minecraft.world.entity.LivingEntity entity, float amount) Increases the mana value of the given entity.- Parameters:
entity- The entity to increase the mana value for.amount- The amount to increase the mana value by.- Returns:
- True if the operation succeeded, false otherwise.
-
decreaseMana
boolean decreaseMana(net.minecraft.world.entity.LivingEntity entity, float amount) Decreases the mana value of the given entity. If the entity has less mana than given, this method does nothing.- Parameters:
entity- The entity to decrease the mana value for.- Returns:
- True if the entity had enough mana, false otherwise.
-
decreaseMana
boolean decreaseMana(net.minecraft.world.entity.LivingEntity entity, float mana, boolean force) Decreases the mana value of the given entity. If force is true and the entity has less mana than given, sets the mana value to 0. If force is false and the entity has less mana than given, this method does nothing.- Parameters:
entity- The entity to decrease the mana value for.- Returns:
- True if the entity had enough mana, false otherwise.
-
setMana
boolean setMana(net.minecraft.world.entity.LivingEntity entity, float amount) Sets the mana value of the given entity.- Parameters:
entity- The entity to set the mana value for.amount- The amount to set the mana value to.
-