Class 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
-
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.RemovalReasonNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.AttachmentHolder.AsField -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatThe velocity with which a Poké Ball will bounce off a surface.static final intThe number of ticks that the Poké Ball will appear open.static final intThe total number of ticks that the entire beam animation will take.static final intThe number of ticks it will take for a Poké Ball's beam to extend.static final intThe number of ticks that a Poké Ball's beam will be fully extended.static final intThe number of ticks it will take for a Poké Ball's beam to retract.protected booleanWhether the Poké Ball will catch the Pokémon.protected net.minecraft.world.phys.Vec3protected EntityDataSyncManagerprotected booleanWhether to drop an item when the Poké Ball makes contact with something.protected floatThe yaw of the Poké Ball at the end of its travel.Variable used to increment animation.protected floatThe initial scale of the Poké Ball.The previous animation of the Poké Ball.protected Stringprotected floatThe angle between the Poké Ball's lids when it opens.protected ParticleArcaneryprotected PixelmonEntityThe entity of the Pokémon being caught by the Poké Ball.static final floatThe model scale of the Poké Ball.protected intprotected booleanstatic final DataSync<PokeBallEntity, AnimationType> static final DataSync<PokeBallEntity, Boolean> static final DataSync<PokeBallEntity, Integer> static final DataSync<PokeBallEntity, Float> static final DataSync<PokeBallEntity, Float> static final DataSync<PokeBallEntity, Boolean> static final DataSync<PokeBallEntity, Boolean> static final DataSync<PokeBallEntity, PokeBallMode> protected static final DataSync<PokeBallEntity, Optional<UUID>> static final DataSync<PokeBallEntity, Integer> protected static final DataSync<PokeBallEntity, Optional<UUID>> static final DataSync<PokeBallEntity, PokeBall> protected static final DataSync<PokeBallEntity, Byte> protected net.minecraft.world.entity.LivingEntityThe player who threw the Poké Ball.protected final intThe number of ticks required for a single shake of the Poké Ball.protected intThe 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, zOldFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.minecraft.commands.CommandSource
NULLFields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME -
Constructor Summary
ConstructorsConstructorDescriptionPokeBallEntity(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 TypeMethodDescriptionvoidbaseTick()protected <A> voiddefine(net.minecraft.network.syncher.SynchedEntityData.Builder builder, DataSync<?, A> sync, A value) protected voiddefineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder) protected voiddoCaptureCalc(Pokemon pokemon) Calculates whether the Pokémon will be caught and the number of shakes the Poké Ball will execute.protected voidDeprecated, 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.Vec3net.minecraft.world.item.ItemStack[]booleanGets whether the Poké Ball will attempt a critical capture.floatGets the initial pitch of the Poké Ball.floatGets the initial yaw of the Poké Ball.protected booleanGets whether the Poké Ball is on the ground.booleanGets whether the Poké Ball is in an animation.net.minecraft.world.item.ItemStackgetItem()getMode()Gets the current mode of the Poké Ball.getModel()Gets the Poké Ball's model.net.minecraft.network.chat.ComponentgetName()net.minecraft.world.entity.EntityintintGets the Poké Ball's entity ID.intnet.minecraft.world.entity.LivingEntityintprotected voidmoveCloser(float percent) Moves the Pokémon closer to the Poké Ball upon attempting capture.voidSpawns particles from certain Poké Balls when the capture attempt starts.voidMakes the Poké Ball bounce up upon hitting a Pixelmon.voidStarts the timer for the animation to suck the Pixelmon into the Poké Ball (the beam animation).voidMakes the Poké Ball bounce up upon hitting a Pixelmon.voidonSyncedDataUpdated(net.minecraft.network.syncher.EntityDataAccessor<?> key) voidIn the Pokémon games critical capture attempts produce a different sound, have a unique animation, and only require one shake to occur.voidSpawns a particle if the Poké Ball is a Premier Ball.voidSpawns particles when a pokemon is sent outvoidAdds 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.voidsetAnimation(AnimationType animation) Sets the animation the Poké Ball is currently in.protected voidsetCritical(boolean value) Sets whether the Poké Ball will attempt a critical capture.voidsetInitialPitch(float pitch) Sets the initial pitch of the Poké Ball.voidsetInitialYaw(float yaw) Sets the initial yaw of the Poké Ball.protected voidsetIsOnGround(boolean value) Sets whether the Poké Ball is on the ground.protected voidsetIsWaiting(boolean value) Sets whether the Poké Ball is in an animation.voidsetItem(net.minecraft.world.item.ItemStack p_37447_) voidsetModel(ModelPokeballs model) voidsetOwnerId(UUID ownerUuid) voidsetPairedEntity(net.minecraft.world.entity.Entity entity) voidsetPokeballID(int id) Sets the Poké Ball's entity ID.svoidsetPokeUUID(UUID pokeUUID) voidvoidSpawns particles and plays a success sound when the capture succeeds.voidtick()voidTicks a Poké Ball entity that does not have a trainer's Pokémon in it.voidTicks a Poké Ball entity that has a trainer's Pokémon in it.voidThis function makes sure the Poké Ball stops (doesn't fall through the world) when it touches the ground, containsplaySoundAndAnimationOfCriticalCapture(), 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.voidRotates the Poké Ball each tick.voidSets the values necessary to make a Pixelmon glow red and disappear into a Poké Ball.voidStops the Poké Ball in the air while sending out a Pokémon.voidwhileBeamIsFullyExtended(int scaleStartTime) voidwhileBeamIsStillExtending(int scaleStartTime) Methods inherited from class net.minecraft.world.entity.projectile.ThrowableItemProjectile
addAdditionalSaveData, getDefaultItem, readAdditionalSaveDataMethods inherited from class net.minecraft.world.entity.projectile.ThrowableProjectile
canUsePortal, getDefaultGravity, shouldRenderAtSqrDistanceMethods 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, updateRotationMethods 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, waterSwimSoundMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.commands.CommandSource
alwaysAcceptsMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods 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, shouldRiderSitMethods inherited from interface net.minecraft.world.scores.ScoreHolder
getFeedbackDisplayName
-
Field Details
-
BEAM_ANIMATION_TIME_TICKS
public static final int BEAM_ANIMATION_TIME_TICKSThe total number of ticks that the entire beam animation will take.- See Also:
-
BEAM_EXTENSION_TIME
public static final int BEAM_EXTENSION_TIMEThe 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_TIMEThe number of ticks that a Poké Ball's beam will be fully extended.- See Also:
-
BEAM_RETRACTION_TIME
public static final int BEAM_RETRACTION_TIMEThe 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_TICKSThe number of ticks that the Poké Ball will appear open.- See Also:
-
BALL_BOUNCE_UP_VELOCITY
public static final float BALL_BOUNCE_UP_VELOCITYThe velocity with which a Poké Ball will bounce off a surface. This is not a multiplier.- See Also:
-
SYNC_POKEBALL_TYPE
-
SYNC_IS_WAITING
-
SYNC_IS_ON_GROUND
-
SYNC_INITIAL_YAW
-
SYNC_ANIMATION
-
SYNC_ID
-
SYNC_INITIAL_PITCH
-
SYNC_MODE
-
SYNC_OWNER
-
SYNC_POKE_UUID
-
SYNC_SLOT
-
SYNC_CRITICAL
-
SYNC_PAIRED_ENTITY
-
ticksPerShake
protected final int ticksPerShakeThe number of ticks required for a single shake of the Poké Ball.- See Also:
-
waitTimer
protected int waitTimerThe Poké Ball's animation timer. This is set to an initial value and then counts down to 0. -
SCALE
public static final float SCALEThe model scale of the Poké Ball.- See Also:
-
thrower
protected net.minecraft.world.entity.LivingEntity throwerThe player who threw the Poké Ball. -
pixelmon
The entity of the Pokémon being caught by the Poké Ball. -
endRotationYaw
protected float endRotationYawThe yaw of the Poké Ball at the end of its travel. -
dropItem
protected boolean dropItemWhether to drop an item when the Poké Ball makes contact with something. -
canCatch
protected boolean canCatchWhether the Poké Ball will catch the Pokémon. -
openAngle
protected float openAngleThe angle between the Poké Ball's lids when it opens. -
initialScale
protected float initialScaleThe initial scale of the Poké Ball. -
inc
Variable used to increment animation. -
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
-
particle
-
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:
getNamein interfacenet.minecraft.world.Nameable- Overrides:
getNamein classnet.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:
defineSynchedDatain classnet.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:
tickin classnet.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()andwhileBeamAnimationForFullPokeBallIsActive() -
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)andwhileBeamIsStillExtending(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(), andwhileBeamAnimationForEmptyPokeBallIsActive(). -
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, containsplaySoundAndAnimationOfCriticalCapture(), 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_CRITsound 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:
baseTickin classnet.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, 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
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
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
Sets the animation the Poké Ball is currently in.- Parameters:
animation- The animation the Poké Ball is currently in.
-
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
Gets the current mode of the Poké Ball.- Returns:
- The current mode of the Poké Ball.
-
getModel
Gets the Poké Ball's model. Initializes it if it is not initialized.- Returns:
- The Poké Ball's model.
-
setModel
-
getShakeCount
public int getShakeCount() -
getWaitTimer
public int getWaitTimer() -
getOwnerId
-
setOwnerId
-
getPokeUUID
-
setPokeUUID
-
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:
onSyncedDataUpdatedin interfacenet.minecraft.network.syncher.SyncedDataHolder- Overrides:
onSyncedDataUpdatedin classnet.minecraft.world.entity.Entity
-
getItem
public net.minecraft.world.item.ItemStack getItem()- Specified by:
getItemin interfacenet.minecraft.world.entity.projectile.ItemSupplier- Overrides:
getItemin classnet.minecraft.world.entity.projectile.ThrowableItemProjectile
-
setItem
public void setItem(net.minecraft.world.item.ItemStack p_37447_) - Overrides:
setItemin classnet.minecraft.world.entity.projectile.ThrowableItemProjectile
-
getLinkedBattle
-