Class Fangs
java.lang.Object
com.binaris.wizardry.api.content.spell.Spell
com.binaris.wizardry.content.spell.earth.Fangs
-
Field Summary
Fields inherited from class com.binaris.wizardry.api.content.spell.Spell
pitch, pitchVariation, volume -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancast(EntityCastContext ctx) This cast method is meant to be used for spells that are cast by an entity source, like a mob.booleancast(LocationCastContext ctx) This cast method is meant to be used for spells that are not cast by an entity, but rather by a non-entity source, like a command block or a dispenser.booleancast(PlayerCastContext ctx) This cast method is meant to be used for spells that are cast by a player source.static voidonHurt(EBLivingHurtEvent event) protected @NotNull SpellPropertiesThis method is where you should set the default properties for your spell when creating a new spell class.protected booleanspawnFangs(CastContext ctx, net.minecraft.world.phys.Vec3 origin, net.minecraft.world.phys.Vec3 direction) Methods inherited from class com.binaris.wizardry.api.content.spell.Spell
assignProperties, canCastByEntity, canCastByLocation, 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
-
Constructor Details
-
Fangs
public Fangs()
-
-
Method Details
-
onHurt
-
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.
- Specified by:
castin classSpell- 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.
-
cast
Description copied from class:SpellThis cast method is meant to be used for spells that are cast by an entity source, like a mob. This is useful for spells that are meant to be cast by entities, 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 entities.
- Overrides:
castin classSpell- Parameters:
ctx- The context of the spell cast, containing information about the world, caster, 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.
-
cast
Description copied from class:SpellThis cast method is meant to be used for spells that are not cast by an entity, but rather by a non-entity source, like a command block or a dispenser. This is useful for spells that are meant to be cast in a specific location without needing an entity to cast them. By default, this returns false, as most spells are meant to be cast by entities. You can override this to return true if your spell is meant to be cast by non-entity sources and to implement the casting behavior for that case.- Overrides:
castin classSpell- Parameters:
ctx- The context of the spell cast, containing information about the world, location, 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.
-
spawnFangs
protected boolean spawnFangs(CastContext ctx, net.minecraft.world.phys.Vec3 origin, net.minecraft.world.phys.Vec3 direction) -
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.- Specified by:
propertiesin classSpell- Returns:
- A SpellProperties object with the default properties for your spell.
-