Class ProjectileEntity
- All Implemented Interfaces:
- Ownable,- CommandOutput,- Nameable,- EntityLike
- Direct Known Subclasses:
- ExplosiveProjectileEntity,- FireworkRocketEntity,- FishingBobberEntity,- LlamaSpitEntity,- PersistentProjectileEntity,- ShulkerBulletEntity,- ThrownEntity
- Mappings:
- Namespace - Name - official - bzg- intermediary - net/minecraft/class_1676- named - net/minecraft/entity/projectile/ProjectileEntity
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraft.entity.EntityEntity.MoveEffect, Entity.PositionUpdater, Entity.RemovalReason
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanFields inherited from class net.minecraft.entity.Entityage, collidedSoftly, dataTracker, DEFAULT_FRICTION, DEFAULT_MIN_FREEZE_DAMAGE_TICKS, DEFAULT_PORTAL_COOLDOWN, distanceTraveled, FALL_FLYING_FLAG_INDEX, fallDistance, field_29991, field_44870, field_44871, field_44872, firstUpdate, FLAGS, fluidHeight, FREEZING_DAMAGE_INTERVAL, GLOWING_FLAG_INDEX, groundCollision, horizontalCollision, horizontalSpeed, ID_KEY, ignoreCameraFrustum, inNetherPortal, inPowderSnow, intersectionChecked, lastNetherPortalPosition, lastRenderX, lastRenderY, lastRenderZ, MAX_COMMAND_TAGS, MAX_RIDING_COOLDOWN, MIN_RISING_BUBBLE_COLUMN_SPEED, movementMultiplier, netherPortalTime, noClip, ON_FIRE_FLAG_INDEX, PASSENGERS_KEY, POSE, prevHorizontalSpeed, prevPitch, prevX, prevY, prevYaw, prevZ, random, ridingCooldown, speed, submergedInWater, supportingBlockPos, timeUntilRegen, touchingWater, uuid, UUID_KEY, uuidString, velocityDirty, velocityModified, verticalCollision, wasInPowderSnow, wasOnFireFields inherited from interface net.minecraft.server.command.CommandOutputDUMMY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanbooleancanModifyAt(World world, BlockPos pos) Returns whether the entity can modify the world atpos.Returns a packet to notify the clients of the entity's spawning.Returns the cause entity of any effect applied by this projectile.getOwner()protected booleanprotected voidonBlockHit(BlockHitResult blockHitResult) protected voidonCollision(HitResult hitResult) protected voidonEntityHit(EntityHitResult entityHitResult) voidonSpawnPacket(EntitySpawnS2CPacket packet) Called on the client when the entity receives a spawn packet.protected voidReads custom data fromnbt.voidvoidsetVelocity(double x, double y, double z, float speed, float divergence) Sets velocity and updates rotation accordingly.voidsetVelocity(Entity shooter, float pitch, float yaw, float roll, float speed, float divergence) Sets velocity and updates rotation accordingly.voidsetVelocityClient(double x, double y, double z) private booleanvoidtick()Ticks this entity.protected voidprotected static floatupdateRotation(float prevRot, float newRot) protected voidWrites custom data tonbt.Methods inherited from class net.minecraft.entity.EntityaddAirTravelEffects, addCommandTag, addFlapEffects, addPassenger, addVelocity, addVelocity, adjustMovementForCollisions, adjustMovementForPiston, adjustMovementForSneaking, animateDamage, applyDamageEffects, applyMirror, applyRotation, attemptTickInVoid, baseTick, bypassesLandingEffects, bypassesSteppingEffects, calculateBoundingBox, calculateBoundsForPose, calculateDimensions, calculateNextStepSoundDistance, canAddPassenger, canAvoidTraps, canBeHitByProjectile, canBeSpectated, canExplosionDestroyBlock, canFreeze, canHit, canMoveVoluntarily, canSprintAsVehicle, canStartRiding, canUsePortals, changeLookDirection, checkBlockCollision, checkDespawn, collidesWith, collidesWithStateAtPos, copyFrom, copyPositionAndRotation, couldAcceptPassenger, damage, detach, discard, dismountVehicle, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, emitGameEvent, emitGameEvent, entityDataRequiresOperator, equals, equipStack, extinguish, extinguishWithSound, fall, getAir, getArmorItems, getBlockPos, getBlockStateAtPos, getBlockX, getBlockY, getBlockZ, getBodyY, getBodyYaw, getBoundingBox, getBrightnessAtEyes, getBurningDuration, getCameraPosVec, getChunkPos, getClientCameraPosVec, getCommandSource, getCommandTags, getControllingPassenger, getControllingVehicle, getCustomName, getDamageSources, getDataTracker, getDefaultName, getDefaultPortalCooldown, getDimensions, getDisplayName, getEffectiveExplosionResistance, getEntityName, getEntityWorld, getEyeHeight, getEyeHeight, getEyePos, getEyeY, getFireTicks, getFirstPassenger, getFlag, getFluidHeight, getFreezingScale, getFrozenTicks, getHandItems, getHandPosOffset, getHeadYaw, getHeight, getHeightOffset, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getId, getItemsEquipped, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getLeashOffset, getLeashOffset, getLeashPos, getLerpedPos, getMaxAir, getMaxNetherPortalTime, getMinFreezeDamageTicks, getMountedHeightOffset, getMoveEffect, getMovementDirection, getName, getNameLabelHeight, getOppositeRotationVector, getOppositeRotationVector, getParticleX, getParticleZ, getPassengerDismountOffset, getPassengerList, getPassengersDeep, getPermissionLevel, getPickBlockStack, getPistonBehavior, getPitch, getPitch, getPortalCooldown, getPortalRect, getPos, getPose, getPosWithYOffset, getRandomBodyY, getRemovalReason, getRenderDistanceMultiplier, getRootVehicle, getRotationClient, getRotationVec, getRotationVecClient, getRotationVector, getRotationVector, getSafeFallDistance, getSavedEntityId, getScoreboardTeam, getServer, getSoundCategory, getSplashSound, getStackReference, getStandingEyeHeight, getStepHeight, getSteppingBlockState, getSteppingPos, getStepSoundPos, getSwimHeight, getSwimSound, getSyncedPos, getTargetingMargin, getTeamColorValue, getTeleportTarget, getTrackedPosition, getType, getUuid, getUuidAsString, getVehicle, getVelocity, getVelocityAffectingPos, getVelocityMultiplier, getVisibilityBoundingBox, getWidth, getWorld, getX, getY, getYaw, getYaw, getZ, handleAttack, handleFallDamage, handleStatus, hasCollidedSoftly, hasControllingPassenger, hasCustomName, hashCode, hasNoGravity, hasPassenger, hasPassenger, hasPassengerDeep, hasPassengers, hasPermissionLevel, hasPlayerRider, hasPortalCooldown, hasVehicle, initDataTracker, interact, interactAt, isAlive, isAttackable, isCollidable, isConnectedThroughVehicle, isCrawling, isCustomNameVisible, isDescending, isFireImmune, isFlappingWings, isFrozen, isGlowing, isGlowingLocal, isImmuneToExplosion, isInLava, isInPose, isInRange, isInRange, isInsideWall, isInsideWaterOrBubbleColumn, isInSneakingPose, isInSwimmingPose, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isLiving, isLogicalSideForUpdatingMovement, isOnFire, isOnGround, isOnRail, isPartOf, isPlayer, isPushable, isPushedByFluids, isRegionUnloaded, isRemoved, isSilent, isSneaking, isSneaky, isSpectator, isSprinting, isSubmergedIn, isSubmergedInWater, isSupportedBy, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, kill, limitFallDistance, lookAt, move, moveToWorld, occludeVibrationSignals, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onDamaged, onDataTrackerUpdate, onKilledOther, onLanding, onPassengerLookAround, onPlayerCollision, onRemoved, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, onSwimmingStart, onTrackedDataSet, playCombinationStepSounds, playExtinguishSound, playSecondaryStepSound, playSound, playSoundIfNotSilent, playStepSound, playSwimSound, playSwimSound, populateCrashReport, positionInPortal, pushAwayFrom, pushOutOfBlocks, raycast, readNbt, refreshPosition, refreshPositionAfterTeleport, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, reinitDimensions, remove, removeAllPassengers, removeFromDimension, removePassenger, removeScoreboardTag, requestTeleport, requestTeleportAndDismount, requestTeleportOffset, resetPortalCooldown, resetPosition, saveNbt, saveSelfNbt, scheduleVelocityUpdate, sendMessage, setAir, setBodyYaw, setBoundingBox, setChangeListener, setCustomName, setCustomNameVisible, setFireTicks, setFlag, setFrozenTicks, setGlowing, setHeadYaw, setId, setInNetherPortal, setInPowderSnow, setInvisible, setInvulnerable, setNoGravity, setOnFire, setOnFireFor, setOnFireFromLava, setOnGround, setOnGround, setPitch, setPortalCooldown, setPos, setPose, setPosition, setPosition, setRemoved, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSprinting, setStepHeight, setSwimming, setUuid, setVelocity, setVelocity, setWorld, setYaw, shouldBroadcastConsoleToOps, shouldDismountUnderwater, shouldEscapePowderSnow, shouldReceiveFeedback, shouldRender, shouldRender, shouldRenderName, shouldSave, shouldSetPositionOnLoad, shouldSpawnSprintingParticles, shouldTrackOutput, slowMovement, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, startRiding, startRiding, stopRiding, streamPassengersAndSelf, streamSelfAndPassengers, teleport, teleport, tickInVoid, tickPortal, tickPortalCooldown, tickRiding, toNbtList, toNbtList, toString, tryCheckBlockCollision, unsetRemoved, updateEventHandler, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateSupportingBlockPos, updateSwimming, updateTrackedHeadRotation, updateTrackedPosition, updateTrackedPositionAndAngles, updateVelocity, updateWaterState, wouldPoseNotCollide, writeNbtMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.server.command.CommandOutputcannotBeSilenced
- 
Field Details- 
ownerUuid- Mappings:
- Namespace - Name - Mixin selector - official - b- Lbzg;b:Ljava/util/UUID;- intermediary - field_22478- Lnet/minecraft/class_1676;field_22478:Ljava/util/UUID;- named - ownerUuid- Lnet/minecraft/entity/projectile/ProjectileEntity;ownerUuid:Ljava/util/UUID;
 
- 
owner- Mappings:
- Namespace - Name - Mixin selector - official - c- Lbzg;c:Lbfj;- intermediary - field_33399- Lnet/minecraft/class_1676;field_33399:Lnet/minecraft/class_1297;- named - owner- Lnet/minecraft/entity/projectile/ProjectileEntity;owner:Lnet/minecraft/entity/Entity;
 
- 
leftOwnerprivate boolean leftOwner- Mappings:
- Namespace - Name - Mixin selector - official - d- Lbzg;d:Z- intermediary - field_23740- Lnet/minecraft/class_1676;field_23740:Z- named - leftOwner- Lnet/minecraft/entity/projectile/ProjectileEntity;leftOwner:Z
 
- 
shotprivate boolean shot- Mappings:
- Namespace - Name - Mixin selector - official - e- Lbzg;e:Z- intermediary - field_28646- Lnet/minecraft/class_1676;field_28646:Z- named - shot- Lnet/minecraft/entity/projectile/ProjectileEntity;shot:Z
 
 
- 
- 
Constructor Details- 
ProjectileEntityProjectileEntity(EntityType<? extends ProjectileEntity> type, World world) - Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lbfj;<init>(Lbfn;Lcmm;)V- intermediary - <init>- Lnet/minecraft/class_1297;<init>(Lnet/minecraft/class_1299;Lnet/minecraft/class_1937;)V- named - <init>- Lnet/minecraft/entity/Entity;<init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)V
 
 
- 
- 
Method Details- 
setOwner- Mappings:
- Namespace - Name - Mixin selector - official - b- Lbzg;b(Lbfj;)V- intermediary - method_7432- Lnet/minecraft/class_1676;method_7432(Lnet/minecraft/class_1297;)V- named - setOwner- Lnet/minecraft/entity/projectile/ProjectileEntity;setOwner(Lnet/minecraft/entity/Entity;)V
 
- 
getOwner
- 
getEffectCauseReturns the cause entity of any effect applied by this projectile. If this projectile has an owner, the effect is attributed to the owner; otherwise, it is attributed to this projectile itself.- Returns:
- the cause entity of any effect applied by this projectile
- Mappings:
- Namespace - Name - Mixin selector - official - A- Lbzg;A()Lbfj;- intermediary - method_37225- Lnet/minecraft/class_1676;method_37225()Lnet/minecraft/class_1297;- named - getEffectCause- Lnet/minecraft/entity/projectile/ProjectileEntity;getEffectCause()Lnet/minecraft/entity/Entity;
 
- 
writeCustomDataToNbtWrites custom data tonbt. Subclasses has to implement this.NBT is a storage format; therefore, a data from NBT is loaded to an entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the entity. - Specified by:
- writeCustomDataToNbtin class- Entity
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lbfj;b(Lqr;)V- intermediary - method_5652- Lnet/minecraft/class_1297;method_5652(Lnet/minecraft/class_2487;)V- named - writeCustomDataToNbt- Lnet/minecraft/entity/Entity;writeCustomDataToNbt(Lnet/minecraft/nbt/NbtCompound;)V
 
- 
isOwner- Mappings:
- Namespace - Name - Mixin selector - official - d- Lbzg;d(Lbfj;)Z- intermediary - method_34714- Lnet/minecraft/class_1676;method_34714(Lnet/minecraft/class_1297;)Z- named - isOwner- Lnet/minecraft/entity/projectile/ProjectileEntity;isOwner(Lnet/minecraft/entity/Entity;)Z
 
- 
readCustomDataFromNbtReads custom data fromnbt. Subclasses has to implement this.NBT is a storage format; therefore, a data from NBT is loaded to an entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the entity. nbtmight not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.- Specified by:
- readCustomDataFromNbtin class- Entity
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbfj;a(Lqr;)V- intermediary - method_5749- Lnet/minecraft/class_1297;method_5749(Lnet/minecraft/class_2487;)V- named - readCustomDataFromNbt- Lnet/minecraft/entity/Entity;readCustomDataFromNbt(Lnet/minecraft/nbt/NbtCompound;)V
 
- 
tickpublic void tick()Ticks this entity.
- 
shouldLeaveOwnerprivate boolean shouldLeaveOwner()- Mappings:
- Namespace - Name - Mixin selector - official - k- Lbzg;k()Z- intermediary - method_26961- Lnet/minecraft/class_1676;method_26961()Z- named - shouldLeaveOwner- Lnet/minecraft/entity/projectile/ProjectileEntity;shouldLeaveOwner()Z
 
- 
setVelocitypublic void setVelocity(double x, double y, double z, float speed, float divergence) Sets velocity and updates rotation accordingly.The velocity and rotation will be set to the same direction. The direction is calculated as follows: Based on the direction vector (x, y, z), a random vector is added, then multiplied by thespeed.- Parameters:
- x- the X component of the direction vector
- y- the Y component of the direction vector
- z- the Z component of the direction vector
- speed- the speed
- divergence- the fuzziness added to the direction; player usages have 1.0 and other mobs/tools have higher values; some mobs have difficulty-adjusted values
- Mappings:
- Namespace - Name - Mixin selector - official - c- Lbzg;c(DDDFF)V- intermediary - method_7485- Lnet/minecraft/class_1676;method_7485(DDDFF)V- named - setVelocity- Lnet/minecraft/entity/projectile/ProjectileEntity;setVelocity(DDDFF)V
 
- 
setVelocitypublic void setVelocity(Entity shooter, float pitch, float yaw, float roll, float speed, float divergence) Sets velocity and updates rotation accordingly.- Parameters:
- shooter- the entity who shot this projectile; used to add the shooter's velocity to this projectile
- pitch- the pitch
- yaw- the yaw
- roll- the roll
- speed- the speed
- divergence- the fuzziness added to the direction; player usages have 1.0 and other mobs/tools have higher values; some mobs have difficulty-adjusted values
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbzg;a(Lbfj;FFFFF)V- intermediary - method_24919- Lnet/minecraft/class_1676;method_24919(Lnet/minecraft/class_1297;FFFFF)V- named - setVelocity- Lnet/minecraft/entity/projectile/ProjectileEntity;setVelocity(Lnet/minecraft/entity/Entity;FFFFF)V
 
- 
onCollision- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbzg;a(Leeg;)V- intermediary - method_7488- Lnet/minecraft/class_1676;method_7488(Lnet/minecraft/class_239;)V- named - onCollision- Lnet/minecraft/entity/projectile/ProjectileEntity;onCollision(Lnet/minecraft/util/hit/HitResult;)V
 
- 
onEntityHit- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbzg;a(Leef;)V- intermediary - method_7454- Lnet/minecraft/class_1676;method_7454(Lnet/minecraft/class_3966;)V- named - onEntityHit- Lnet/minecraft/entity/projectile/ProjectileEntity;onEntityHit(Lnet/minecraft/util/hit/EntityHitResult;)V
 
- 
onBlockHit- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbzg;a(Leee;)V- intermediary - method_24920- Lnet/minecraft/class_1676;method_24920(Lnet/minecraft/class_3965;)V- named - onBlockHit- Lnet/minecraft/entity/projectile/ProjectileEntity;onBlockHit(Lnet/minecraft/util/hit/BlockHitResult;)V
 
- 
setVelocityClientpublic void setVelocityClient(double x, double y, double z) - Overrides:
- setVelocityClientin class- Entity
- Mappings:
- Namespace - Name - Mixin selector - official - l- Lbfj;l(DDD)V- intermediary - method_5750- Lnet/minecraft/class_1297;method_5750(DDD)V- named - setVelocityClient- Lnet/minecraft/entity/Entity;setVelocityClient(DDD)V
 
- 
canHit- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbzg;a(Lbfj;)Z- intermediary - method_26958- Lnet/minecraft/class_1676;method_26958(Lnet/minecraft/class_1297;)Z- named - canHit- Lnet/minecraft/entity/projectile/ProjectileEntity;canHit(Lnet/minecraft/entity/Entity;)Z
 
- 
updateRotationprotected void updateRotation()- Mappings:
- Namespace - Name - Mixin selector - official - C- Lbzg;C()V- intermediary - method_26962- Lnet/minecraft/class_1676;method_26962()V- named - updateRotation- Lnet/minecraft/entity/projectile/ProjectileEntity;updateRotation()V
 
- 
updateRotationprotected static float updateRotation(float prevRot, float newRot) - Mappings:
- Namespace - Name - Mixin selector - official - d- Lbzg;d(FF)F- intermediary - method_26960- Lnet/minecraft/class_1676;method_26960(FF)F- named - updateRotation- Lnet/minecraft/entity/projectile/ProjectileEntity;updateRotation(FF)F
 
- 
createSpawnPacketReturns a packet to notify the clients of the entity's spawning.- Overrides:
- createSpawnPacketin class- Entity
- Returns:
- a packet to notify the clients of the entity's spawning
- Mappings:
- Namespace - Name - Mixin selector - official - S- Lbfj;S()Luo;- intermediary - method_18002- Lnet/minecraft/class_1297;method_18002()Lnet/minecraft/class_2596;- named - createSpawnPacket- Lnet/minecraft/entity/Entity;createSpawnPacket()Lnet/minecraft/network/packet/Packet;
 
- 
onSpawnPacketCalled on the client when the entity receives a spawn packet.This sets the entity's position, angles, ID, and UUID. Subclasses can override this to initialize additional fields. - Overrides:
- onSpawnPacketin class- Entity
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbfj;a(Lus;)V- intermediary - method_31471- Lnet/minecraft/class_1297;method_31471(Lnet/minecraft/class_2604;)V- named - onSpawnPacket- Lnet/minecraft/entity/Entity;onSpawnPacket(Lnet/minecraft/network/packet/s2c/play/EntitySpawnS2CPacket;)V
 
- 
canModifyAtReturns whether the entity can modify the world atpos.This returns truefor most entities. Players checkWorld.canPlayerModifyAt(net.minecraft.entity.player.PlayerEntity, net.minecraft.util.math.BlockPos)to prevent them from modifying entities in the spawn protection or outside the world border.ProjectileEntitydelegates it to the owner if the owner is a player; if the owner is a non-player entity, this returns the value ofGameRules.DO_MOB_GRIEFING, and ownerless projectiles are always allowed to modify the world.- Overrides:
- canModifyAtin class- Entity
- Returns:
- whether the entity can modify the world at pos
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbfj;a(Lcmm;Lgu;)Z- intermediary - method_36971- Lnet/minecraft/class_1297;method_36971(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Z- named - canModifyAt- Lnet/minecraft/entity/Entity;canModifyAt(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Z
 
 
-