Class SpellFieldAnchorEntity

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.entity.Entity>
net.minecraftforge.common.capabilities.CapabilityProvider.Entities
net.minecraft.world.entity.Entity
johnsmith.enchantmentcore.api.enchantment.spellfield.entity.SpellFieldAnchorEntity
All Implemented Interfaces:
SpellFieldAnchor, net.minecraft.core.component.DataComponentGetter, net.minecraft.core.TypedInstance<net.minecraft.world.entity.EntityType<?>>, net.minecraft.network.syncher.SyncedDataHolder, net.minecraft.util.debug.DebugValueSource, net.minecraft.world.entity.ItemOwner, net.minecraft.world.entity.SlotProvider, net.minecraft.world.level.entity.EntityAccess, net.minecraft.world.level.entity.UniquelyIdentifyable, net.minecraft.world.Nameable, net.minecraft.world.scores.ScoreHolder, net.minecraftforge.common.capabilities.ICapabilityProvider, net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.entity.Entity>, net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.common.extensions.IForgeEntity, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class SpellFieldAnchorEntity extends net.minecraft.world.entity.Entity implements SpellFieldAnchor
Non-physical, invulnerable marker entity that acts as a persistent or delayed world-space origin for a SpellFieldComponent.

Supports configurable activation delays, duty-cycle pulsing (activePhase and restPhase), custom tick intervals (tickRate), scheduled sub-tasks, and client-synchronized visual rendering parameters exposed through SpellFieldAnchor.

  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.entity.Entity

    net.minecraft.world.entity.Entity.Flags, net.minecraft.world.entity.Entity.MoveFunction, net.minecraft.world.entity.Entity.MovementEmission, net.minecraft.world.entity.Entity.RemovalReason

    Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B>, net.minecraftforge.common.capabilities.CapabilityProvider.BlockEntities, net.minecraftforge.common.capabilities.CapabilityProvider.Entities, net.minecraftforge.common.capabilities.CapabilityProvider.ItemStacks, net.minecraftforge.common.capabilities.CapabilityProvider.Levels

    Nested classes/interfaces inherited from interface net.minecraft.util.debug.DebugValueSource

    net.minecraft.util.debug.DebugValueSource.Registration, net.minecraft.util.debug.DebugValueSource.ValueGetter<T>

    Nested classes/interfaces inherited from interface net.minecraft.world.entity.ItemOwner

    net.minecraft.world.entity.ItemOwner.OffsetFromOwner
  • Field Summary

    Fields inherited from class net.minecraft.world.entity.Entity

    BASE_SAFE_FALL_DISTANCE, BASE_TICKS_REQUIRED_TO_FREEZE, blocksBuilding, BOARDING_COOLDOWN, boardingCooldown, CONTENTS_SLOT_INDEX, DATA_POSE, DATA_SHARED_FLAGS_ID, DEFAULT_BB_HEIGHT, DEFAULT_BB_WIDTH, DEFAULT_BELOW_NAME_DISTANCE, DEFAULT_NAME_TAG_DISTANCE, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_2, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_5, DELTA_AFFECTED_BY_BLOCKS_BELOW_1_0, entityData, fallDistance, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, flyDist, FREEZE_HURT_FREQUENCY, horizontalCollision, hurtMarked, INVALID_ENTITY_ID, invulnerableTime, isInPowderSnow, LOGGER, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, MAX_MOVEMENTS_HANDELED_PER_TICK, MAX_NAME_TAG_DISTANCE, minorHorizontalCollision, moveDist, needsSync, noPhysics, portalProcess, random, stringUUID, stuckSpeedMultiplier, syncPosition, TAG_AIR, TAG_CUSTOM_NAME, TAG_DATA, TAG_FALL_DISTANCE, TAG_FIRE, TAG_GLOWING, TAG_ID, TAG_INVULNERABLE, TAG_MOTION, TAG_NO_GRAVITY, TAG_ON_GROUND, TAG_PASSENGERS, TAG_PORTAL_COOLDOWN, TAG_POS, TAG_ROTATION, TAG_SILENT, TAG_UUID, tickCount, TOTAL_AIR_SUPPLY, uuid, verticalCollision, verticalCollisionBelow, wasEyeInWater, wasInPowderSnow, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOld

    Fields inherited from interface net.minecraft.world.scores.ScoreHolder

    WILDCARD, WILDCARD_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpellFieldAnchorEntity(net.minecraft.world.entity.EntityType<?> entityType, net.minecraft.world.level.Level level)
    Constructs a new SpellFieldAnchorEntity with physics disabled.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addAdditionalSaveData(net.minecraft.world.level.storage.ValueOutput output)
     
    protected void
    defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder)
     
    Retrieves the unique resource location string for the entity's custom model definition.
    int
    Retrieves the total frame count defined for the visual texture animation logic.
    float
    Retrieves the physical scaling scalar applied during the rendering pipeline.
    Retrieves the unique resource location string for the entity's base visual texture.
    int
    Retrieves the duration in ticks applied to each animation frame.
    int
    Retrieves the RGB color tint applied across the visual rendering pass.
    boolean
    hurtServer(net.minecraft.server.level.ServerLevel serverlevel, net.minecraft.world.damagesource.DamageSource source, float amount)
     
    boolean
    ignoreExplosion(net.minecraft.world.level.Explosion explosion)
    Inflates the render culling bounding box by the configured visual scale so large anchor visuals are not prematurely frustum-culled.
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    protected void
    readAdditionalSaveData(net.minecraft.world.level.storage.ValueInput input)
     
    void
    schedule(int ticksFromNow, Runnable action)
    Schedules a runnable task to be executed on the server thread after the specified number of ticks.
    void
    setAnchorData(int lifeTime, int tickRate, int activationDelay, int activePhase, int restPhase, SpellFieldComponent spellField, int enchantmentLevel, net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.entity.EquipmentSlot slot, net.minecraft.world.entity.Entity owner)
    Configures the operational lifecycle and spell field payload for this anchor entity.
    void
    Applies and synchronizes the provided AnchorVisualConfig to this entity's tracked data parameters.
    void
    Advances the anchor's position, executes any due scheduled tasks, evaluates duty-cycle timing, and dispatches the bound SpellFieldComponent on the server thread.

    Methods inherited from class net.minecraft.world.entity.Entity

    absSnapRotationTo, absSnapTo, absSnapTo, addDeltaMovement, addPassenger, addTag, adjustSpawnLocation, animateHurt, applyComponentsFromItemStack, applyEffectsFromBlocks, applyEffectsFromBlocks, applyEffectsFromBlocksForLastMovements, applyGravity, applyImplicitComponent, applyImplicitComponentIfPresent, applyImplicitComponents, awardKillScore, baseTick, belowNameDisplay, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canBeHitByProjectile, canBePickedFromInside, canCollideWith, canControlVehicle, canFreeze, canInteractWithLevel, canRide, canSimulateMovement, canSpawnSprintParticle, canSprint, canTeleport, canTrample, canUpdate, canUpdate, canUsePortal, captureDrops, captureDrops, castComponentValue, causeFallDamage, checkBelowWorld, checkDespawn, checkFallDamage, checkFallDistanceAccumulation, checkSupportingBlock, chunkPosition, clearFire, clearFreeze, clearMovementThisTick, closerThan, closerThan, collectAllColliders, collideBoundingBox, collideBoundingBox, collidedWithFluid, collidedWithShapeMovingFrom, computeSpeed, considersEntityAsAlly, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStackForNameResolution, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doCheckFallDamage, doWaterSplashEffect, dropAllLeashConnections, ejectPassengers, entityTags, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, forceSetRotation, fudgePositionAfterSizeChange, gameEvent, gameEvent, get, getAddEntityPacket, getAirDrag, getAirSupply, getAttachments, getAvailableSpaceBelow, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockSpeedFactor, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getCollisionHorizontalEscapeVector, getControlledVehicle, getControllingPassenger, getCustomName, getDefaultGravity, getDefaultPassengerAttachmentPoint, getDeltaMovement, getDimensionChangingDelay, getDimensions, getDirection, getDismountLocationForPassenger, getDisplayName, getEffectiveGravity, getEncodeId, getEntityBounciness, getEntityData, getEyeHeight, getEyeHeight, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidInteraction, getFluidInteractionBox, getFluidJumpThreshold, getForward, getGravity, getHandHoldingItemAngle, getHeadLookAngle, getId, getInBlockState, getIndirectPassengers, getInputVector, getInterpolation, getKnownMovement, getKnownSpeed, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getLootTable, getMaxAirSupply, getMaxFallDistance, getMotionDirection, getMovementEmission, getName, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengerRidingPosition, getPassengers, getPassengersAndSelf, getPercentFrozen, getPersistentData, getPickRadius, getPickResult, getPistonPushReaction, getPortalCooldown, getPose, getPosition, getPositionCodec, getPreciseBodyRotation, getPrimaryStepSoundBlockPos, getQuadLeashHolderOffsets, getRandom, getRandomX, getRandomY, getRandomY, getRandomZ, getRelativePortalPosition, getRemainingFireTicks, getRemovalReason, getRequiresPrecisePosition, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getSharedFlag, getSlot, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getVehicleAttachmentPoint, getViewScale, getViewVector, getViewXRot, getViewYRot, getVisualRotationYInDegrees, getWeaponItem, getX, getX, getXRot, getXRot, getY, getY, getYHeadRot, getYRot, getYRot, getZ, getZ, handleDamageEvent, handleEntityEvent, handleOnAboveBubbleColumn, handleOnInsideBubbleColumn, handlePortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasMovedHorizontallyRecently, hasPassenger, hasPassenger, hasPose, hurt, hurtClient, hurtOrSimulate, igniteForSeconds, igniteForTicks, interact, is, isAddedToLevel, isAffectedByBlocks, isAlive, isAlliedTo, isAlliedTo, isAlwaysTicking, isClientAuthoritative, isColliding, isCrouching, isCurrentlyGlowing, isCustomNameVisible, isDescending, isDiscrete, isEffectiveAi, isEyeInFluid, isFlapping, isFlyingVehicle, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInClouds, isInFluidType, isInFluidType, isInLava, isInLiquid, isInShallowWater, isInterpolating, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableToBase, isInvulnerableToPiercingWeapon, isInWall, isInWater, isInWaterOrRain, isInWaterOrSwimmable, isLocalClientAuthoritative, isLocalInstanceAuthoritative, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, isVisuallySwimming, kill, killedEntity, lavaHurt, lavaIgnite, lerpHeadTo, lerpMotion, lerpPositionAndRotationStep, level, limitPistonMovement, load, lookAt, makeBoundingBox, makeBoundingBox, makeStuckInBlock, markHurt, maxUpStep, maybeBackOffFromEdge, mayInteract, mirror, modifyPassengerFluidInteractionBox, move, moveOrInterpolateTo, moveOrInterpolateTo, moveOrInterpolateTo, moveOrInterpolateTo, moveRelative, moveTowardsClosestSpace, nextStep, notifyLeasheeRemoved, notifyLeashHolder, oldPosition, omnidirectionalAirMover, onAboveBubbleColumn, onAddedToLevel, onBelowWorld, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onPassengerTurned, onRemoval, onRemovedFromLevel, onSyncedDataUpdated, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, positionRider, problemPath, processFlappingMovement, processPortalCooldown, propagateFallToPassengers, push, push, push, reapplyPosition, recreateFromPacket, refreshDimensions, registerDebugValues, registryAccess, remove, removeAfterChangingDimensions, removeLatestMovementRecording, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rideTick, rotate, save, saveAsPassenger, saveWithoutId, sendBubbleColumnParticles, setAirSupply, setAsInsidePortal, setBoundingBox, setComponent, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPos, setOldPosAndRot, setOldPosAndRot, setOldRot, setOnGround, setOnGroundWithMovement, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRequiresPrecisePosition, setRot, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSprinting, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYBodyRot, setYHeadRot, setYRot, shearOffAllLeashConnections, shouldBeSaved, shouldBlockExplode, shouldPlayLavaHurtSound, shouldRender, shouldRenderAtSqrDistance, shouldShowName, showVehicleHealth, skipAttackInteraction, snapTo, snapTo, snapTo, snapTo, snapTo, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopRiding, stopSeenByPlayer, supportQuadLeashAsHolder, syncPacketPositionCodec, teleport, teleportRelative, teleportSetPosition, teleportSetPosition, teleportSpectators, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, turn, typeHolder, unRide, unsetRemoved, updateDataBeforeSync, updateDynamicGameEventListener, updateFluidInteraction, updateSwimming, waterSwimSound

    Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider.Entities

    fireAttachCapabilitiesEvent, shouldFireAttachCapabilitiesEvent

    Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps, serializeCaps

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.core.component.DataComponentGetter

    getOrDefault, getTyped

    Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider

    getCapability, getCapability

    Methods inherited from interface net.minecraftforge.common.extensions.IForgeEntity

    canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canSwimInFluidType, deserializeNBT, getClassification, getFluidFallDistanceModifier, getFluidMotionScale, getFluidTypeHeight, getMaxHeightFluidType, getParts, getSoundFromFluidType, hasCustomOutlineRendering, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, serializeNBT, shouldRiderSit, shouldUpdateFluidWhileBoating

    Methods inherited from interface net.minecraft.world.entity.ItemOwner

    asLivingEntity

    Methods inherited from interface net.minecraft.world.Nameable

    getPlainTextName

    Methods inherited from interface net.minecraft.world.scores.ScoreHolder

    getFeedbackDisplayName

    Methods inherited from interface net.minecraft.world.entity.SlotProvider

    getSlotsFromRange

    Methods inherited from interface net.minecraft.core.TypedInstance

    is, is, is, is, is, tags
  • Constructor Details

    • SpellFieldAnchorEntity

      public SpellFieldAnchorEntity(net.minecraft.world.entity.EntityType<?> entityType, net.minecraft.world.level.Level level)
      Constructs a new SpellFieldAnchorEntity with physics disabled.
      Parameters:
      entityType - The entity type definition.
      level - The level in which the entity is instantiated.
  • Method Details

    • setAnchorData

      public void setAnchorData(int lifeTime, int tickRate, int activationDelay, int activePhase, int restPhase, SpellFieldComponent spellField, int enchantmentLevel, net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.entity.EquipmentSlot slot, net.minecraft.world.entity.Entity owner)
      Configures the operational lifecycle and spell field payload for this anchor entity.
      Parameters:
      lifeTime - Total lifetime of the anchor in ticks.
      tickRate - Interval in ticks between spell field applications.
      activationDelay - Initial delay in ticks before the anchor activates.
      activePhase - Duration in ticks of each active phase in the duty cycle.
      restPhase - Duration in ticks of each rest phase in the duty cycle.
      spellField - The SpellFieldComponent payload to execute.
      enchantmentLevel - The enchantment level context.
      itemStack - The source enchanted item stack.
      slot - The equipment slot associated with the item.
      owner - The entity that triggered or owns this spell field anchor, or null.
    • setVisualConfig

      public void setVisualConfig(AnchorVisualConfig config)
      Applies and synchronizes the provided AnchorVisualConfig to this entity's tracked data parameters.
      Parameters:
      config - The visual configuration to apply, or null for no-op.
    • ignoreExplosion

      public boolean ignoreExplosion(net.minecraft.world.level.Explosion explosion)
      Inflates the render culling bounding box by the configured visual scale so large anchor visuals are not prematurely frustum-culled.
      Overrides:
      ignoreExplosion in class net.minecraft.world.entity.Entity
      Returns:
      The inflated culling AABB.
    • isPushable

      public boolean isPushable()
      Overrides:
      isPushable in class net.minecraft.world.entity.Entity
    • isPushedByFluid

      public boolean isPushedByFluid()
      Overrides:
      isPushedByFluid in class net.minecraft.world.entity.Entity
    • isPickable

      public boolean isPickable()
      Overrides:
      isPickable in class net.minecraft.world.entity.Entity
    • isAttackable

      public boolean isAttackable()
      Overrides:
      isAttackable in class net.minecraft.world.entity.Entity
    • hurtServer

      public boolean hurtServer(net.minecraft.server.level.ServerLevel serverlevel, net.minecraft.world.damagesource.DamageSource source, float amount)
      Specified by:
      hurtServer in class net.minecraft.world.entity.Entity
    • getVisualTexture

      public String getVisualTexture()
      Description copied from interface: SpellFieldAnchor
      Retrieves the unique resource location string for the entity's base visual texture.
      Specified by:
      getVisualTexture in interface SpellFieldAnchor
      Returns:
      The resource location string.
    • getModelId

      public String getModelId()
      Description copied from interface: SpellFieldAnchor
      Retrieves the unique resource location string for the entity's custom model definition.
      Specified by:
      getModelId in interface SpellFieldAnchor
      Returns:
      The resource location string, or null if no model is defined.
    • getVisualScale

      public float getVisualScale()
      Description copied from interface: SpellFieldAnchor
      Retrieves the physical scaling scalar applied during the rendering pipeline.
      Specified by:
      getVisualScale in interface SpellFieldAnchor
      Returns:
      The visual scale multiplier.
    • getVisualFrames

      public int getVisualFrames()
      Description copied from interface: SpellFieldAnchor
      Retrieves the total frame count defined for the visual texture animation logic.
      Specified by:
      getVisualFrames in interface SpellFieldAnchor
      Returns:
      The total number of animation frames.
    • getVisualTickRate

      public int getVisualTickRate()
      Description copied from interface: SpellFieldAnchor
      Retrieves the duration in ticks applied to each animation frame.
      Specified by:
      getVisualTickRate in interface SpellFieldAnchor
      Returns:
      The number of ticks per frame.
    • getVisualTint

      public int getVisualTint()
      Description copied from interface: SpellFieldAnchor
      Retrieves the RGB color tint applied across the visual rendering pass.
      Specified by:
      getVisualTint in interface SpellFieldAnchor
      Returns:
      The RGB tint color integer.
    • schedule

      public void schedule(int ticksFromNow, Runnable action)
      Schedules a runnable task to be executed on the server thread after the specified number of ticks.
      Parameters:
      ticksFromNow - Delay in ticks relative to the entity's current Entity.tickCount.
      action - The runnable action to execute.
    • tick

      public void tick()
      Advances the anchor's position, executes any due scheduled tasks, evaluates duty-cycle timing, and dispatches the bound SpellFieldComponent on the server thread.
      Overrides:
      tick in class net.minecraft.world.entity.Entity
    • defineSynchedData

      protected void defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder)
      Specified by:
      defineSynchedData in class net.minecraft.world.entity.Entity
    • readAdditionalSaveData

      protected void readAdditionalSaveData(net.minecraft.world.level.storage.ValueInput input)
      Specified by:
      readAdditionalSaveData in class net.minecraft.world.entity.Entity
    • addAdditionalSaveData

      protected void addAdditionalSaveData(net.minecraft.world.level.storage.ValueOutput output)
      Specified by:
      addAdditionalSaveData in class net.minecraft.world.entity.Entity