Class Cobwebs
java.lang.Object
com.binaris.wizardry.api.content.spell.Spell
com.binaris.wizardry.content.spell.abstr.RaySpell
com.binaris.wizardry.content.spell.earth.Cobwebs
-
Field Summary
Fields inherited from class com.binaris.wizardry.content.spell.abstr.RaySpell
aimAssist, hitLiquids, ignoreLivingEntities, ignoreUncollidables, particleJitter, particleSpacing, particleVelocity, Y_OFFSETFields inherited from class com.binaris.wizardry.api.content.spell.Spell
pitch, pitchVariation, volume -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanonBlockHit(CastContext ctx, net.minecraft.world.phys.BlockHitResult blockHit, net.minecraft.world.phys.Vec3 origin) Called when the ray hits a block.protected booleanonEntityHit(CastContext ctx, net.minecraft.world.phys.EntityHitResult entityHit, net.minecraft.world.phys.Vec3 origin) Called when the ray hits an entity.protected booleanonMiss(CastContext ctx, net.minecraft.world.phys.Vec3 origin, net.minecraft.world.phys.Vec3 direction) Called when the ray does not hit any entities or blocks.protected @NotNull SpellPropertiesThis method is where you should set the default properties for your spell when creating a new spell class.booleanWhether this spell requires a packet to be sent on client when it is cast.Methods inherited from class com.binaris.wizardry.content.spell.abstr.RaySpell
aimAssist, canCastByEntity, canCastByLocation, cast, cast, cast, hitLiquids, ignoreLivingEntities, ignoreUncollidables, particleJitter, particleSpacing, particleVelocity, shootSpell, spawnParticle, spawnParticleRayMethods 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, soundValues, toString
-
Constructor Details
-
Cobwebs
public Cobwebs()
-
-
Method Details
-
onBlockHit
protected boolean onBlockHit(CastContext ctx, net.minecraft.world.phys.BlockHitResult blockHit, net.minecraft.world.phys.Vec3 origin) Description copied from class:RaySpellCalled when the ray hits a block. Override this method to perform an action when the ray hits a block, such as creating an explosion or spawning particles. Return true if the spell should be considered successfully cast when it hits a block, or false if the spell should not be cast when it hits a block (e.g. if you want to prevent casting when the ray is blocked by an uncollidable block and ignoreUncollidables is true).- Specified by:
onBlockHitin classRaySpell- Parameters:
ctx- The cast context of the spell.blockHit- The result of the block hit, containing information about the hit position and block.origin- The starting point of the ray.- Returns:
- true if the spell should be considered successfully cast when it hits a block, false if the spell should not be cast when it hits a block.
-
onMiss
protected boolean onMiss(CastContext ctx, net.minecraft.world.phys.Vec3 origin, net.minecraft.world.phys.Vec3 direction) Description copied from class:RaySpellCalled when the ray does not hit any entities or blocks. Override this method to perform an action when the ray misses, such as spawning particles at the endpoint. Return true if the spell should be considered successfully cast even when it misses, or false if the spell should not be cast when it misses (e.g. if you want to prevent casting when the ray is blocked by an uncollidable block and ignoreUncollidables is true).- Specified by:
onMissin classRaySpell- Parameters:
ctx- The cast context of the spell.origin- The starting point of the ray.direction- The normalized direction vector of the ray.- Returns:
- true if the spell should be considered successfully cast even when it misses, false if the spell should not be cast when it misses.
-
onEntityHit
protected boolean onEntityHit(CastContext ctx, net.minecraft.world.phys.EntityHitResult entityHit, net.minecraft.world.phys.Vec3 origin) Description copied from class:RaySpellCalled when the ray hits an entity. Override this method to perform an action when the ray hits an entity, such as dealing damage or applying a status effect. Return true if the spell should be considered successfully cast when it hits an entity, or false if the spell should not be cast when it hits an entity (e.g. if you want to prevent casting when the ray is blocked by an uncollidable block and ignoreUncollidables is true).- Specified by:
onEntityHitin classRaySpell- Parameters:
ctx- The cast context of the spell.entityHit- The result of the entity hit, containing information about the hit entity and hit position.origin- The starting point of the ray.- Returns:
- true if the spell should be considered successfully cast when it hits an entity, false if the spell should not be cast when it hits an entity.
-
requiresPacket
public boolean requiresPacket()Description copied from class:SpellWhether this spell requires a packet to be sent on client when it is cast. Returns true by default, but can be overridden to return false if the spell's cast() method does not use any code that must be executed client-side (i.e. particle spawning).If in doubt, leave this method as is; it is purely an optimization.
- Overrides:
requiresPacketin classSpell- Returns:
- true if the spell code should be run on the server and all clients in the dimension, false if the spell code should only be run on the server and the client of the player casting it.
-
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.
-