Class ReplenishHunger
java.lang.Object
com.binaris.wizardry.api.content.spell.Spell
com.binaris.wizardry.content.spell.abstr.BuffSpell
com.binaris.wizardry.content.spell.healing.ReplenishHunger
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SpellProperty<Integer>static final SpellProperty<Float>Fields inherited from class com.binaris.wizardry.content.spell.abstr.BuffSpell
b, g, mobEffects, particleCount, rFields inherited from class com.binaris.wizardry.api.content.spell.Spell
pitch, pitchVariation, volume -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanapplyEffects(CastContext ctx, net.minecraft.world.entity.LivingEntity caster) Applies the mob effects to the target.booleanWhether this spell can be cast by an entity source (e.g.booleanWhether this spell can be cast by a non-entity source (e.g.booleancast(PlayerCastContext ctx) This cast method is meant to be used for spells that are cast by a player source.protected @NotNull SpellPropertiesThis method is where you should set the default properties for your spell when creating a new spell class.Methods inherited from class com.binaris.wizardry.content.spell.abstr.BuffSpell
cast, cast, getEffectDurationProperty, getEffectStrengthProperty, getMobEffects, getStandardBonusAmplifier, particleCount, spawnParticlesMethods inherited from class com.binaris.wizardry.api.content.spell.Spell
assignProperties, endCast, equals, getAction, getChargeUp, getCooldown, getCost, getDesc, getDescriptionFormatted, getDescriptionId, getElement, getIcon, getLocation, getLoopSounds, getOrCreateDescriptionId, getOrCreateLocation, getPitch, getPitchVariation, getProperties, getTier, getType, getVolume, isEnabled, isInstantCast, onCharge, playSound, playSound, playSound, playSoundLoop, playSoundLoop, property, requiresPacket, soundValues, toString
-
Field Details
-
HUNGER_POINTS
-
SATURATION_MODIFIER
-
-
Constructor Details
-
ReplenishHunger
public ReplenishHunger()
-
-
Method Details
-
applyEffects
Description copied from class:BuffSpellApplies the mob effects to the target. The duration and amplifier of the effects are calculated based on the spell properties and the potency and duration modifiers of the cast context.- Overrides:
applyEffectsin classBuffSpell- Parameters:
ctx- the cast context of the spell, used to get the modifiers for duration and potency, as well as the world for applying the effects.caster- the target of the spell, the entity that is going to receive the mob effects. Normally the caster, but if the spell is cast by location, it will be the nearest entity to the selected location.- Returns:
- true if the effects were applied, false if the target already had all the effects or if there was an error applying the effects.
-
cast
Description copied from class:SpellThis cast method is meant to be used for spells that are cast by a player source. This is useful for spells that are meant to be cast by players, as it provides more information about the caster and the context of the cast.Override this method to implement the casting behavior for spells that are meant to be cast by players.
- Overrides:
castin classBuffSpell- Parameters:
ctx- The context of the spell cast, containing information about the world, caster, hand used, modifiers, etc.- Returns:
- true if the spell was successfully cast, false otherwise. If this returns false, the spell will not be considered as having been cast, so no cooldown will be applied.
-
canCastByEntity
public boolean canCastByEntity()Description copied from class:SpellWhether this spell can be cast by an entity source (e.g. a player or a mob). By default, this returns false, as some spells may be designed to only be cast by non-entity sources, but you can override this to return true if your spell is meant to be cast by entities.- Overrides:
canCastByEntityin classBuffSpell- Returns:
- true if this spell can be cast by an entity source, false otherwise.
-
canCastByLocation
public boolean canCastByLocation()Description copied from class:SpellWhether this spell can be cast by a non-entity source (e.g. a command block or a dispenser). By default, this returns false, as most spells are meant to be cast by entities, but you can override this to return true if your spell is designed to be cast by non-entity sources.- Overrides:
canCastByLocationin classBuffSpell- Returns:
- true if this spell can be cast by a non-entity source, false otherwise.
-
properties
Description copied from class:SpellThis method is where you should set the default properties for your spell when creating a new spell class. This method is called in the constructor of the Spell class, and the properties returned by this method are assigned to the spell's properties field.- Overrides:
propertiesin classBuffSpell- Returns:
- A SpellProperties object with the default properties for your spell.
-