Class PokeBallEntity

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
net.minecraft.world.entity.projectile.Projectile
net.minecraft.world.entity.projectile.ThrowableProjectile
net.minecraft.world.entity.projectile.ThrowableItemProjectile
com.pixelmonmod.pixelmon.entities.pokeballs.PokeBallEntity
All Implemented Interfaces:
net.minecraft.commands.CommandSource, net.minecraft.network.syncher.SyncedDataHolder, net.minecraft.world.entity.projectile.ItemSupplier, net.minecraft.world.entity.TraceableEntity, net.minecraft.world.level.entity.EntityAccess, net.minecraft.world.Nameable, net.minecraft.world.scores.ScoreHolder, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.common.extensions.IEntityExtension, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Direct Known Subclasses:
EmptyPokeBallEntity, OccupiedPokeBallEntity

public abstract class PokeBallEntity extends net.minecraft.world.entity.projectile.ThrowableItemProjectile
A Poké Ball entity in the world.
  • Nested Class Summary

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

    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.neoforged.neoforge.attachment.AttachmentHolder

    net.neoforged.neoforge.attachment.AttachmentHolder.AsField
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final float
    The velocity with which a Poké Ball will bounce off a surface.
    static final int
    The number of ticks that the Poké Ball will appear open.
    static final int
    The total number of ticks that the entire beam animation will take.
    static final int
    The number of ticks it will take for a Poké Ball's beam to extend.
    static final int
    The number of ticks that a Poké Ball's beam will be fully extended.
    static final int
    The number of ticks it will take for a Poké Ball's beam to retract.
    protected boolean
    Whether the Poké Ball will catch the Pokémon.
    protected net.minecraft.world.phys.Vec3
     
     
    protected boolean
    Whether to drop an item when the Poké Ball makes contact with something.
    protected float
    The yaw of the Poké Ball at the end of its travel.
    Variable used to increment animation.
    protected float
    The initial scale of the Poké Ball.
    The previous animation of the Poké Ball.
    protected String
     
    protected float
    The angle between the Poké Ball's lids when it opens.
     
    protected PixelmonEntity
    The entity of the Pokémon being caught by the Poké Ball.
    static final float
    The model scale of the Poké Ball.
    protected int
     
    protected boolean
     
     
     
     
     
     
     
     
     
    protected static final DataSync<PokeBallEntity,Optional<UUID>>
     
     
    protected static final DataSync<PokeBallEntity,Optional<UUID>>
     
     
    protected static final DataSync<PokeBallEntity,Byte>
     
    protected net.minecraft.world.entity.LivingEntity
    The player who threw the Poké Ball.
    protected final int
    The number of ticks required for a single shake of the Poké Ball.
    protected int
    The Poké Ball's animation timer.

    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, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_2, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_5, DELTA_AFFECTED_BY_BLOCKS_BELOW_1_0, dimensions, ENTITY_COUNTER, entityData, eyeHeight, fallDistance, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, flyDist, forgeFluidTypeHeight, FREEZE_HURT_FREQUENCY, hasImpulse, horizontalCollision, hurtMarked, ID_TAG, invulnerableTime, isInPowderSnow, level, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, minorHorizontalCollision, moveDist, noCulling, noPhysics, PASSENGERS_TAG, portalProcess, random, stringUUID, stuckSpeedMultiplier, tickCount, TOTAL_AIR_SUPPLY, uuid, UUID_TAG, verticalCollision, verticalCollisionBelow, walkDist, walkDistO, wasEyeInWater, wasInPowderSnow, wasOnFire, wasTouchingWater, xo, xOld, xRot, xRotO, yo, yOld, yRot, yRotO, zo, zOld

    Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    ATTACHMENTS_NBT_KEY

    Fields inherited from interface net.minecraft.commands.CommandSource

    NULL

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

    WILDCARD, WILDCARD_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
    PokeBallEntity(net.minecraft.world.entity.EntityType<? extends PokeBallEntity> entityType, PokeBall type, net.minecraft.world.level.Level world, net.minecraft.world.entity.LivingEntity thrower, PokeBallMode mode)
    Initializes the specified Poké Ball and its data watcher attributes.
    PokeBallEntity(net.minecraft.world.entity.EntityType<? extends PokeBallEntity> type, net.minecraft.world.level.Level world)
    Initializes an ordinary Poké Ball and its data watcher attributes.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected <A> void
    define(net.minecraft.network.syncher.SynchedEntityData.Builder builder, DataSync<?,A> sync, A value)
     
    protected void
    defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder)
     
    protected void
    Calculates whether the Pokémon will be caught and the number of shakes the Poké Ball will execute.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the animation the Poké Ball is currently in.
    Gets the Poké Ball's type.
    abstract net.minecraft.world.phys.Vec3
     
    net.minecraft.world.item.ItemStack[]
     
    boolean
    Gets whether the Poké Ball will attempt a critical capture.
    float
    Gets the initial pitch of the Poké Ball.
    float
    Gets the initial yaw of the Poké Ball.
    protected boolean
    Gets whether the Poké Ball is on the ground.
    boolean
    Gets whether the Poké Ball is in an animation.
    net.minecraft.world.item.ItemStack
     
     
    Gets the current mode of the Poké Ball.
    Gets the Poké Ball's model.
    net.minecraft.network.chat.Component
     
     
    net.minecraft.world.entity.Entity
     
    int
     
    int
    Gets the Poké Ball's entity ID.
     
    int
     
    net.minecraft.world.entity.LivingEntity
     
    int
     
    protected void
    moveCloser(float percent)
    Moves the Pokémon closer to the Poké Ball upon attempting capture.
    void
    Spawns particles from certain Poké Balls when the capture attempt starts.
    void
    Makes the Poké Ball bounce up upon hitting a Pixelmon.
    void
    Starts the timer for the animation to suck the Pixelmon into the Poké Ball (the beam animation).
    void
    Makes the Poké Ball bounce up upon hitting a Pixelmon.
    void
    onSyncedDataUpdated(net.minecraft.network.syncher.EntityDataAccessor<?> key)
     
    void
    In the Pokémon games critical capture attempts produce a different sound, have a unique animation, and only require one shake to occur.
    void
    Spawns a particle if the Poké Ball is a Premier Ball.
    void
    Spawns particles when a pokemon is sent out
    void
    Adds a trainer's Pixelmon on their team to the world as an entity and also handles values for rendering the Poké Ball's red beam to release the Pokémon.
    void
    Sets the animation the Poké Ball is currently in.
    protected void
    setCritical(boolean value)
    Sets whether the Poké Ball will attempt a critical capture.
    void
    setInitialPitch(float pitch)
    Sets the initial pitch of the Poké Ball.
    void
    setInitialYaw(float yaw)
    Sets the initial yaw of the Poké Ball.
    protected void
    setIsOnGround(boolean value)
    Sets whether the Poké Ball is on the ground.
    protected void
    setIsWaiting(boolean value)
    Sets whether the Poké Ball is in an animation.
    void
    setItem(net.minecraft.world.item.ItemStack p_37447_)
     
    void
     
    void
    setOwnerId(UUID ownerUuid)
     
    void
    setPairedEntity(net.minecraft.world.entity.Entity entity)
     
    void
    setPokeballID(int id)
    Sets the Poké Ball's entity ID.s
    void
    setPokeUUID(UUID pokeUUID)
     
    void
     
    void
    Spawns particles and plays a success sound when the capture succeeds.
    void
     
    void
    Ticks a Poké Ball entity that does not have a trainer's Pokémon in it.
    void
    Ticks a Poké Ball entity that has a trainer's Pokémon in it.
    void
    This function makes sure the Poké Ball stops (doesn't fall through the world) when it touches the ground, contains playSoundAndAnimationOfCriticalCapture(), and makes sure a Poké Ball on the ground that is attempting to capture a Pokémon shakes the ball left or right and plays a sound each time it does that.
    void
    Rotates the Poké Ball each tick.
    void
    Sets the values necessary to make a Pixelmon glow red and disappear into a Poké Ball.
    void
    Stops the Poké Ball in the air while sending out a Pokémon.
    void
    whileBeamIsFullyExtended(int scaleStartTime)
     
    void
    whileBeamIsStillExtending(int scaleStartTime)
     

    Methods inherited from class net.minecraft.world.entity.projectile.ThrowableItemProjectile

    addAdditionalSaveData, getDefaultItem, readAdditionalSaveData

    Methods inherited from class net.minecraft.world.entity.projectile.ThrowableProjectile

    canUsePortal, getDefaultGravity, shouldRenderAtSqrDistance

    Methods inherited from class net.minecraft.world.entity.projectile.Projectile

    calculateHorizontalHurtKnockbackDirection, canHitEntity, deflect, getAddEntityPacket, getEffectSource, getMovementToShoot, getOwner, getPickRadius, hitTargetOrDeflectSelf, isPickable, lerpMotion, lerpRotation, mayBreak, mayInteract, onDeflection, onHit, onHitBlock, onHitEntity, ownedBy, recreateFromPacket, restoreFrom, setOwner, shoot, shootFromRotation, updateRotation

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

    absMoveTo, absMoveTo, absRotateTo, acceptsFailure, acceptsSuccess, addDeltaMovement, addPassenger, addTag, adjustSpawnLocation, animateHurt, applyGravity, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canBeHitByProjectile, canChangeDimensions, canCollideWith, canControlVehicle, canFreeze, canRide, canSpawnSprintParticle, canSprint, canTrample, captureDrops, captureDrops, causeFallDamage, changeDimension, checkBelowWorld, checkDespawn, checkFallDamage, checkInsideBlocks, checkSlowFallDistance, checkSupportingBlock, chunkPosition, clearFire, closerThan, closerThan, collideBoundingBox, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStack, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doWaterSplashEffect, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, fudgePositionAfterSizeChange, gameEvent, gameEvent, getAirSupply, getAttachments, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockSpeedFactor, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getBoundingBoxForCulling, getCapability, getCapability, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControlledVehicle, getControllingPassenger, getCustomName, getDefaultPassengerAttachmentPoint, getDeltaMovement, getDimensionChangingDelay, getDimensions, getDirection, getDismountLocationForPassenger, getDisplayName, getEncodeId, getEntityData, getEyeHeight, getEyeHeight, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getGravity, getHandHoldingItemAngle, getId, getInBlockState, getIndirectPassengers, getKnownMovement, getLeashOffset, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxFallDistance, getMaxHeightFluidType, getMotionDirection, getMovementEmission, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengerRidingPosition, getPassengers, getPassengersAndSelf, getPercentFrozen, getPermissionLevel, getPersistentData, getPickResult, getPistonPushReaction, getPortalCooldown, getPose, getPosition, getPositionCodec, getPreciseBodyRotation, getPrimaryStepSoundBlockPos, getRandom, getRandomX, getRandomY, getRandomZ, getRelativePortalPosition, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSlot, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getVehicleAttachmentPoint, getViewScale, getViewVector, getViewXRot, getViewYRot, getVisualRotationYInDegrees, getWeaponItem, getX, getX, getXRot, getY, getY, getYHeadRot, getYRot, getZ, getZ, handleDamageEvent, handleEntityEvent, handlePortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, hurt, igniteForSeconds, igniteForTicks, ignoreExplosion, interact, interactAt, is, isAddedToLevel, isAlive, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCurrentlyGlowing, isCustomNameVisible, isDescending, isDiscrete, isEffectiveAi, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInFluidType, isInFluidType, isInLava, isInLiquid, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWall, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isPushable, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, isVisuallySwimming, kill, killedEntity, lavaHurt, lerpHeadTo, lerpPositionAndRotationStep, lerpTargetX, lerpTargetXRot, lerpTargetY, lerpTargetYRot, lerpTargetZ, lerpTo, level, limitPistonMovement, load, lookAt, makeBoundingBox, makeStuckInBlock, markHurt, maxUpStep, maybeBackOffFromEdge, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToLevel, onBelowWorld, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromLevel, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, positionRider, processFlappingMovement, processPortalCooldown, push, push, push, reapplyPosition, refreshDimensions, registryAccess, remove, removeAfterChangingDimensions, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, revive, rideTick, rotate, save, saveAsPassenger, saveWithoutId, sendSystemMessage, setAirSupply, setAsInsidePortal, setBoundingBox, setCustomName, setCustomNameVisible, setData, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRot, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSprinting, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYBodyRot, setYHeadRot, setYRot, shouldBeSaved, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldShowName, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopRiding, stopSeenByPlayer, syncData, syncPacketPositionCodec, teleportRelative, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming, waterSwimSound

    Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachments

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.minecraft.commands.CommandSource

    alwaysAccepts

    Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder

    getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncData

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IEntityExtension

    canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canSwimInFluidType, copyAttachmentsFrom, deserializeNBT, getClassification, getFluidFallDistanceModifier, getFluidMotionScale, getParts, getPickedResult, getSoundFromFluidType, hasCustomOutlineRendering, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, sendPairingData, serializeNBT, shouldRiderSit

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

    getFeedbackDisplayName
  • Field Details

    • BEAM_ANIMATION_TIME_TICKS

      public static final int BEAM_ANIMATION_TIME_TICKS
      The total number of ticks that the entire beam animation will take.
      See Also:
    • BEAM_EXTENSION_TIME

      public static final int BEAM_EXTENSION_TIME
      The number of ticks it will take for a Poké Ball's beam to extend.
      See Also:
    • BEAM_FULL_EXTENSION_TIME

      public static final int BEAM_FULL_EXTENSION_TIME
      The number of ticks that a Poké Ball's beam will be fully extended.
      See Also:
    • BEAM_RETRACTION_TIME

      public static final int BEAM_RETRACTION_TIME
      The number of ticks it will take for a Poké Ball's beam to retract.
      See Also:
    • BALL_STAY_OPEN_TIME_TICKS

      public static final int BALL_STAY_OPEN_TIME_TICKS
      The number of ticks that the Poké Ball will appear open.
      See Also:
    • BALL_BOUNCE_UP_VELOCITY

      public static final float BALL_BOUNCE_UP_VELOCITY
      The velocity with which a Poké Ball will bounce off a surface. This is not a multiplier.
      See Also:
    • SYNC_POKEBALL_TYPE

      public static final DataSync<PokeBallEntity,PokeBall> SYNC_POKEBALL_TYPE
    • SYNC_IS_WAITING

      public static final DataSync<PokeBallEntity,Boolean> SYNC_IS_WAITING
    • SYNC_IS_ON_GROUND

      public static final DataSync<PokeBallEntity,Boolean> SYNC_IS_ON_GROUND
    • SYNC_INITIAL_YAW

      public static final DataSync<PokeBallEntity,Float> SYNC_INITIAL_YAW
    • SYNC_ANIMATION

      public static final DataSync<PokeBallEntity,AnimationType> SYNC_ANIMATION
    • SYNC_ID

      public static final DataSync<PokeBallEntity,Integer> SYNC_ID
    • SYNC_INITIAL_PITCH

      public static final DataSync<PokeBallEntity,Float> SYNC_INITIAL_PITCH
    • SYNC_MODE

      public static final DataSync<PokeBallEntity,PokeBallMode> SYNC_MODE
    • SYNC_OWNER

      protected static final DataSync<PokeBallEntity,Optional<UUID>> SYNC_OWNER
    • SYNC_POKE_UUID

      protected static final DataSync<PokeBallEntity,Optional<UUID>> SYNC_POKE_UUID
    • SYNC_SLOT

      protected static final DataSync<PokeBallEntity,Byte> SYNC_SLOT
    • SYNC_CRITICAL

      public static final DataSync<PokeBallEntity,Boolean> SYNC_CRITICAL
    • SYNC_PAIRED_ENTITY

      public static final DataSync<PokeBallEntity,Integer> SYNC_PAIRED_ENTITY
    • ticksPerShake

      protected final int ticksPerShake
      The number of ticks required for a single shake of the Poké Ball.
      See Also:
    • waitTimer

      protected int waitTimer
      The Poké Ball's animation timer. This is set to an initial value and then counts down to 0.
    • SCALE

      public static final float SCALE
      The model scale of the Poké Ball.
      See Also:
    • thrower

      protected net.minecraft.world.entity.LivingEntity thrower
      The player who threw the Poké Ball.
    • pixelmon

      @CheckForNull protected PixelmonEntity pixelmon
      The entity of the Pokémon being caught by the Poké Ball.
    • endRotationYaw

      protected float endRotationYaw
      The yaw of the Poké Ball at the end of its travel.
    • dropItem

      protected boolean dropItem
      Whether to drop an item when the Poké Ball makes contact with something.
    • canCatch

      protected boolean canCatch
      Whether the Poké Ball will catch the Pokémon.
    • openAngle

      protected float openAngle
      The angle between the Poké Ball's lids when it opens.
    • initialScale

      protected float initialScale
      The initial scale of the Poké Ball.
    • inc

      Variable used to increment animation.
    • lastAnim

      public AnimationType lastAnim
      The previous animation of the Poké Ball.
    • slot

      protected int slot
    • spawnedBeam

      protected boolean spawnedBeam
    • contactPoint

      protected net.minecraft.world.phys.Vec3 contactPoint
    • name

      protected String name
    • particle

      protected ParticleArcanery particle
    • dataSyncManager

      protected EntityDataSyncManager dataSyncManager
  • Constructor Details

    • PokeBallEntity

      public PokeBallEntity(net.minecraft.world.entity.EntityType<? extends PokeBallEntity> type, net.minecraft.world.level.Level world)
      Initializes an ordinary Poké Ball and its data watcher attributes.
      Parameters:
      world - The world the Poké Ball is in.
    • PokeBallEntity

      public PokeBallEntity(net.minecraft.world.entity.EntityType<? extends PokeBallEntity> entityType, PokeBall type, net.minecraft.world.level.Level world, net.minecraft.world.entity.LivingEntity thrower, PokeBallMode mode)
      Initializes the specified Poké Ball and its data watcher attributes.
      Parameters:
      type - The Poké Ball's type.
      world - The world the Poké Ball is in.
      thrower - The player who threw the Poké Ball.
      mode - The mode the Poké Ball is in.
  • Method Details

    • getName

      public net.minecraft.network.chat.Component getName()
      Specified by:
      getName in interface net.minecraft.world.Nameable
      Overrides:
      getName in class net.minecraft.world.entity.Entity
    • spawnRedBeam

      public void spawnRedBeam()
    • getBeamTarget

      @CheckForNull public abstract net.minecraft.world.phys.Vec3 getBeamTarget()
    • getComponentItems

      public net.minecraft.world.item.ItemStack[] getComponentItems()
    • defineSynchedData

      protected void defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder)
      Overrides:
      defineSynchedData in class net.minecraft.world.entity.projectile.ThrowableItemProjectile
    • define

      protected <A> void define(net.minecraft.network.syncher.SynchedEntityData.Builder builder, DataSync<?,A> sync, A value)
    • tick

      public void tick()
      Overrides:
      tick in class net.minecraft.world.entity.projectile.ThrowableProjectile
    • tickOccupiedPokeBall

      public void tickOccupiedPokeBall()
      Ticks a Poké Ball entity that has a trainer's Pokémon in it.

      Contains onFullPokeBallContactingPokemon() and whileBeamAnimationForFullPokeBallIsActive()

    • onFullPokeBallContactingPokemon

      public void onFullPokeBallContactingPokemon()
      Makes the Poké Ball bounce up upon hitting a Pixelmon. Also attempts to make the entity/player that threw the Poké Ball move forward? TODO: why???
    • whileBeamAnimationForFullPokeBallIsActive

      public void whileBeamAnimationForFullPokeBallIsActive()
      Stops the Poké Ball in the air while sending out a Pokémon.

      Makes a non-player entity that sent out the Poké Ball look at where the Poké Ball landed (probably).

      Contains sendOutPokemonAndRenderBeam().

      Closes the Poké Ball, plays a sound for that, and gives the Poké Ball some upwards velocity before the animation finishes.

    • sendOutPokemonAndRenderBeam

      public void sendOutPokemonAndRenderBeam()
      Adds a trainer's Pixelmon on their team to the world as an entity and also handles values for rendering the Poké Ball's red beam to release the Pokémon.

      Contains whileBeamIsFullyExtended(int) and whileBeamIsStillExtending(int).

    • whileBeamIsFullyExtended

      public void whileBeamIsFullyExtended(int scaleStartTime)
    • whileBeamIsStillExtending

      public void whileBeamIsStillExtending(int scaleStartTime)
    • tickEmptyPokeBallInTheAir

      public void tickEmptyPokeBallInTheAir()
      Ticks a Poké Ball entity that does not have a trainer's Pokémon in it.

      Contains onEmptyPokeBallContactingPokemon(), onEmptyPokeBallStoppingInTheAirBeforeCapture(), and whileBeamAnimationForEmptyPokeBallIsActive().

    • onEmptyPokeBallContactingPokemon

      public void onEmptyPokeBallContactingPokemon()
      Makes the Poké Ball bounce up upon hitting a Pixelmon. Also attempts to make the entity/player that threw the Poké Ball move towards where it is looking. TODO: why???
    • onEmptyPokeBallStoppingInTheAirBeforeCapture

      public void onEmptyPokeBallStoppingInTheAirBeforeCapture()
      Starts the timer for the animation to suck the Pixelmon into the Poké Ball (the beam animation). Makes the Poké Ball open its lid.
    • whileBeamAnimationForEmptyPokeBallIsActive

      public void whileBeamAnimationForEmptyPokeBallIsActive()
      Sets the values necessary to make a Pixelmon glow red and disappear into a Poké Ball.

      Occurs after the empty Poké Ball has hit a Pixelmon, opened its lid, and begun the timer for the beam animation.

    • tickRotateThePokeBall

      public void tickRotateThePokeBall()
      Rotates the Poké Ball each tick.
    • tickPokeBallCaptureAttemptShakeAnimation

      public void tickPokeBallCaptureAttemptShakeAnimation()
      This function makes sure the Poké Ball stops (doesn't fall through the world) when it touches the ground, contains playSoundAndAnimationOfCriticalCapture(), and makes sure a Poké Ball on the ground that is attempting to capture a Pokémon shakes the ball left or right and plays a sound each time it does that.
    • playSoundAndAnimationOfCriticalCapture

      public void playSoundAndAnimationOfCriticalCapture()
      In the Pokémon games critical capture attempts produce a different sound, have a unique animation, and only require one shake to occur.

      In this function, we make Pixelmon's critical captures play the SoundEvents.PLAYER_ATTACK_CRIT sound and send out crit particles (ParticleTypes.CRIT).

    • moveCloser

      protected void moveCloser(float percent)
      Moves the Pokémon closer to the Poké Ball upon attempting capture.
      Parameters:
      percent - How close to move the Pokémon.
    • baseTick

      public void baseTick()
      Overrides:
      baseTick in class net.minecraft.world.entity.Entity
    • premierFlash

      public void premierFlash()
      Spawns a particle if the Poké Ball is a Premier Ball.
    • onCaptureAttemptEffect

      public void onCaptureAttemptEffect()
      Spawns particles from certain Poké Balls when the capture attempt starts.
    • successfulCaptureEffect

      public void successfulCaptureEffect()
      Spawns particles and plays a success sound when the capture succeeds.
    • releaseEffect

      public void releaseEffect()
      Spawns particles when a pokemon is sent out
    • doCaptureCalc

      @Deprecated(since="9.3.15", forRemoval=true) protected void doCaptureCalc(PixelmonEntity p2)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Calculates whether the Pokémon will be caught and the number of shakes the Poké Ball will execute.
      Parameters:
      p2 - The Pokémon being captured.
    • doCaptureCalc

      protected void doCaptureCalc(Pokemon pokemon)
      Calculates whether the Pokémon will be caught and the number of shakes the Poké Ball will execute.
      Parameters:
      pokemon - The Pokémon being captured.
    • getBallType

      public PokeBall getBallType()
      Gets the Poké Ball's type.
      Returns:
      The Poké Ball's type.
    • setIsWaiting

      protected void setIsWaiting(boolean value)
      Sets whether the Poké Ball is in an animation.
      Parameters:
      value - Whether the Poké Ball is in an animation.
    • getIsWaiting

      public boolean getIsWaiting()
      Gets whether the Poké Ball is in an animation.
      Returns:
      Whether the Poké Ball is in an animation.
    • setIsOnGround

      protected void setIsOnGround(boolean value)
      Sets whether the Poké Ball is on the ground.
      Parameters:
      value - Whether the Poké Ball is on the ground.
    • getIsOnGround

      protected boolean getIsOnGround()
      Gets whether the Poké Ball is on the ground.
      Returns:
      Whether the Poké Ball is on the ground.
    • setAnimation

      public void setAnimation(AnimationType animation)
      Sets the animation the Poké Ball is currently in.
      Parameters:
      animation - The animation the Poké Ball is currently in.
    • getAnimation

      public AnimationType getAnimation()
      Gets the animation the Poké Ball is currently in.
      Returns:
      The animation the Poké Ball is currently in.
    • getPokeballID

      public int getPokeballID()
      Gets the Poké Ball's entity ID.
      Returns:
      The Poké Ball's entity ID.
    • setPokeballID

      public void setPokeballID(int id)
      Sets the Poké Ball's entity ID.s
      Parameters:
      id - The Poké Ball's entity ID.
    • getInitialYaw

      public float getInitialYaw()
      Gets the initial yaw of the Poké Ball.
      Returns:
      The initial yaw of the Poké Ball.
    • setInitialYaw

      public void setInitialYaw(float yaw)
      Sets the initial yaw of the Poké Ball.
      Parameters:
      yaw - The initial yaw of the Poké Ball.
    • getInitialPitch

      public float getInitialPitch()
      Gets the initial pitch of the Poké Ball.
      Returns:
      The initial pitch of the Poké Ball.
    • setInitialPitch

      public void setInitialPitch(float pitch)
      Sets the initial pitch of the Poké Ball.
      Parameters:
      pitch - The initial pitch of the Poké Ball.
    • setCritical

      protected void setCritical(boolean value)
      Sets whether the Poké Ball will attempt a critical capture.
      Parameters:
      value - Whether the capture attempt is a critical capture.
    • getCritical

      public boolean getCritical()
      Gets whether the Poké Ball will attempt a critical capture.
      Returns:
      True if a critical capture will be attempted.
    • getMode

      public PokeBallMode getMode()
      Gets the current mode of the Poké Ball.
      Returns:
      The current mode of the Poké Ball.
    • getModel

      public ModelPokeballs getModel()
      Gets the Poké Ball's model. Initializes it if it is not initialized.
      Returns:
      The Poké Ball's model.
    • setModel

      public void setModel(ModelPokeballs model)
    • getShakeCount

      public int getShakeCount()
    • getWaitTimer

      public int getWaitTimer()
    • getOwnerId

      public UUID getOwnerId()
    • setOwnerId

      public void setOwnerId(UUID ownerUuid)
    • getPokeUUID

      public UUID getPokeUUID()
    • setPokeUUID

      public void setPokeUUID(UUID pokeUUID)
    • getPairedEntityId

      public int getPairedEntityId()
    • getPairedEntity

      @Nullable public net.minecraft.world.entity.Entity getPairedEntity()
    • setPairedEntity

      public void setPairedEntity(net.minecraft.world.entity.Entity entity)
    • getThrower

      public net.minecraft.world.entity.LivingEntity getThrower()
    • onSyncedDataUpdated

      public void onSyncedDataUpdated(net.minecraft.network.syncher.EntityDataAccessor<?> key)
      Specified by:
      onSyncedDataUpdated in interface net.minecraft.network.syncher.SyncedDataHolder
      Overrides:
      onSyncedDataUpdated in class net.minecraft.world.entity.Entity
    • getItem

      public net.minecraft.world.item.ItemStack getItem()
      Specified by:
      getItem in interface net.minecraft.world.entity.projectile.ItemSupplier
      Overrides:
      getItem in class net.minecraft.world.entity.projectile.ThrowableItemProjectile
    • setItem

      public void setItem(net.minecraft.world.item.ItemStack p_37447_)
      Overrides:
      setItem in class net.minecraft.world.entity.projectile.ThrowableItemProjectile
    • getLinkedBattle

      @Nullable public BattleController getLinkedBattle()