Class ProjectileEntity
- All Implemented Interfaces:
DataTracked,Ownable,ScoreHolder,CommandOutput,Nameable,EntityLike
- Direct Known Subclasses:
ExplosiveProjectileEntity,FireworkRocketEntity,FishingBobberEntity,LlamaSpitEntity,PersistentProjectileEntity,ShulkerBulletEntity,ThrownEntity
- Mappings:
Namespace Name named net/minecraft/entity/projectile/ProjectileEntityintermediary net/minecraft/class_1676official cnp
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.MoveEffect, Entity.PositionUpdater, Entity.RemovalReason -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanFields inherited from class net.minecraft.entity.Entity
age, collidedSoftly, dataTracker, DEFAULT_FRICTION, DEFAULT_MIN_FREEZE_DAMAGE_TICKS, DEFAULT_PORTAL_COOLDOWN, distanceTraveled, FALL_FLYING_FLAG_INDEX, fallDistance, field_44870, field_44871, field_44872, field_49073, field_49791, firstUpdate, FLAGS, fluidHeight, FREEZING_DAMAGE_INTERVAL, GLOWING_FLAG_INDEX, groundCollision, horizontalCollision, horizontalSpeed, ID_KEY, ignoreCameraFrustum, inPowderSnow, intersectionChecked, lastRenderX, lastRenderY, lastRenderZ, MAX_COMMAND_TAGS, MAX_RIDING_COOLDOWN, MIN_RISING_BUBBLE_COLUMN_SPEED, movementMultiplier, noClip, ON_FIRE_FLAG_INDEX, PASSENGERS_KEY, portalManager, 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.CommandOutput
DUMMYFields inherited from interface net.minecraft.scoreboard.ScoreHolder
WILDCARD, WILDCARD_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateVelocity(double x, double y, double z, float power, float uncertainty) booleancanBreakBlocks(World world) booleancanHit()Returns whether the entity can be hit with a projectile or be targeted by the player crosshair.protected booleanbooleancanModifyAt(World world, BlockPos pos) Returns whether the entity can modify the world atpos.voidCopies serializable data and nether portal data fromoriginal.createSpawnPacket(EntityTrackerEntry entityTrackerEntry) Returns a packet to notify the clients of the entity's spawning.booleandeflect(ProjectileDeflection deflection, @Nullable Entity deflector, @Nullable Entity owner, boolean fromAttack) Returns the cause entity of any effect applied by this projectile.getKnockback(LivingEntity target, DamageSource source) getOwner()floatReturns the margin around the entity's bounding box where the entity targeting is still successful.protected ProjectileDeflectionhitOrDeflect(HitResult hitResult) protected booleanprotected voidonBlockHit(BlockHitResult blockHitResult) protected voidonCollision(HitResult hitResult) protected voidonDeflected(@Nullable Entity deflector, boolean fromAttack) 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 power, float uncertainty) 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.Entity
addAirTravelEffects, addCommandTag, addFlapEffects, addPassenger, addPortalChunkTicketAt, addVelocity, addVelocity, addVelocityInternal, adjustMovementForCollisions, adjustMovementForPiston, adjustMovementForSneaking, animateDamage, applyGravity, applyMirror, applyRotation, attemptTickInVoid, baseTick, bypassesLandingEffects, bypassesSteppingEffects, calculateBoundingBox, calculateDimensions, calculateNextStepSoundDistance, canAddPassenger, canAvoidTraps, canBeHitByProjectile, canBeSpectated, canExplosionDestroyBlock, canFreeze, canMoveVoluntarily, canSprintAsVehicle, canStartRiding, canTeleportBetween, canUsePortals, changeLookDirection, checkBlockCollision, checkDespawn, collidesWith, collidesWithStateAtPos, copyPositionAndRotation, couldAcceptPassenger, damage, detach, discard, dismountVehicle, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, emitGameEvent, emitGameEvent, entityDataRequiresOperator, equals, extinguish, extinguishWithSound, fall, getAir, getAttachments, 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, getEntityWorld, getEyeHeight, getEyePos, getEyeY, getFacing, getFinalGravity, getFireTicks, getFirstPassenger, getFlag, getFluidHeight, getFreezingScale, getFrozenTicks, getGravity, getHandPosOffset, getHeadYaw, getHeight, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getId, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getLeashOffset, getLeashOffset, getLeashPos, getLerpedPos, getLerpTargetPitch, getLerpTargetX, getLerpTargetY, getLerpTargetYaw, getLerpTargetZ, getMaxAir, getMinFreezeDamageTicks, getMoveEffect, getMovement, getMovementDirection, getName, getNameForScoreboard, getOppositeRotationVector, getOppositeRotationVector, getParticleX, getParticleZ, getPassengerAttachmentPos, getPassengerAttachmentPos, getPassengerDismountOffset, getPassengerList, getPassengerRidingPos, getPassengersDeep, getPermissionLevel, getPickBlockStack, getPistonBehavior, getPitch, getPitch, getPlayerPassengers, getPortalCooldown, getPos, getPose, getPosWithYOffset, getProjectileDeflection, getRandom, getRandomBodyY, getRegistryManager, getRemovalReason, getRenderDistanceMultiplier, getRootVehicle, getRotationClient, getRotationVec, getRotationVecClient, getRotationVector, getRotationVector, getSafeFallDistance, getSavedEntityId, getScoreboardTeam, getServer, getSoundCategory, getSplashSound, getStackReference, getStandingEyeHeight, getStepHeight, getSteppingBlockState, getSteppingPos, getStepSoundPos, getSwimHeight, getSwimSound, getSyncedPos, getTeamColorValue, getTrackedPosition, getType, getUuid, getUuidAsString, getVehicle, getVehicleAttachmentPos, getVelocity, getVelocityAffectingPos, getVelocityMultiplier, getVisibilityBoundingBox, getWeaponStack, getWidth, getWorld, getWorldSpawnPos, 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, isInFluid, 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, lerpPosAndRotation, lerpYaw, limitFallDistance, lookAt, move, occludeVibrationSignals, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onDamaged, onDataTrackerUpdate, onExplodedBy, onKilledOther, onLanding, onPassengerLookAround, onPlayerCollision, onRemoved, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, onSwimmingStart, onTrackedDataSet, playCombinationStepSounds, playExtinguishSound, playSecondaryStepSound, playSound, playSoundIfNotSilent, playStepSound, playSwimSound, playSwimSound, populateCrashReport, positionInPortal, pushAwayFrom, pushOutOfBlocks, raycast, readNbt, recalculateDimensions, refreshPosition, refreshPositionAfterTeleport, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, refreshPositionAndAngles, reinitDimensions, remove, removeAllPassengers, removeCommandTag, removeFromDimension, removePassenger, requestTeleport, requestTeleportAndDismount, requestTeleportOffset, resetPortalCooldown, resetPosition, saveNbt, saveSelfNbt, scheduleVelocityUpdate, sendMessage, setAir, setAngles, setBodyYaw, setBoundingBox, setChangeListener, setCustomName, setCustomNameVisible, setFireTicks, setFlag, setFrozenTicks, setGlowing, setHeadYaw, setId, setInPowderSnow, setInvisible, setInvulnerable, setNoGravity, setOnFire, setOnFireFor, setOnFireForTicks, setOnFireFromLava, setOnGround, setOnGround, setPitch, setPortalCooldown, setPos, setPose, setPosition, setPosition, setRemoved, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSprinting, setSwimming, setUuid, setVelocity, setVelocity, setWorld, setYaw, shouldBroadcastConsoleToOps, shouldControlVehicles, shouldDismountUnderwater, shouldEscapePowderSnow, shouldReceiveFeedback, shouldRender, shouldRender, shouldRenderName, shouldSave, shouldSetPositionOnLoad, shouldSpawnSprintingParticles, shouldTrackOutput, slowMovement, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, startRiding, startRiding, stopRiding, streamPassengersAndSelf, streamSelfAndPassengers, teleport, teleportTo, tickInVoid, tickPortalCooldown, tickPortalTeleportation, tickRiding, toNbtList, toNbtList, toString, tryCheckBlockCollision, tryUsePortal, unsetRemoved, updateEventHandler, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateSupportingBlockPos, updateSwimming, updateTrackedHeadRotation, updateTrackedPosition, updateTrackedPositionAndAngles, updateVelocity, updateWaterState, writeNbtMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.server.command.CommandOutput
cannotBeSilencedMethods inherited from interface net.minecraft.scoreboard.ScoreHolder
getStyledDisplayName
-
Field Details
-
ownerUuid
- Mappings:
Namespace Name Mixin selector named ownerUuidLnet/minecraft/entity/projectile/ProjectileEntity;ownerUuid:Ljava/util/UUID;intermediary field_22478Lnet/minecraft/class_1676;field_22478:Ljava/util/UUID;official bLcnp;b:Ljava/util/UUID;
-
owner
- Mappings:
Namespace Name Mixin selector named ownerLnet/minecraft/entity/projectile/ProjectileEntity;owner:Lnet/minecraft/entity/Entity;intermediary field_33399Lnet/minecraft/class_1676;field_33399:Lnet/minecraft/class_1297;official cLcnp;c:Lbsr;
-
leftOwner
private boolean leftOwner- Mappings:
Namespace Name Mixin selector named leftOwnerLnet/minecraft/entity/projectile/ProjectileEntity;leftOwner:Zintermediary field_23740Lnet/minecraft/class_1676;field_23740:Zofficial dLcnp;d:Z
-
shot
private boolean shot- Mappings:
Namespace Name Mixin selector named shotLnet/minecraft/entity/projectile/ProjectileEntity;shot:Zintermediary field_28646Lnet/minecraft/class_1676;field_28646:Zofficial eLcnp;e:Z
-
lastDeflectedEntity
- Mappings:
Namespace Name Mixin selector named lastDeflectedEntityLnet/minecraft/entity/projectile/ProjectileEntity;lastDeflectedEntity:Lnet/minecraft/entity/Entity;intermediary field_51621Lnet/minecraft/class_1676;field_51621:Lnet/minecraft/class_1297;official fLcnp;f:Lbsr;
-
-
Constructor Details
-
ProjectileEntity
ProjectileEntity(EntityType<? extends ProjectileEntity> type, World world) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/entity/Entity;<init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)Vintermediary <init>Lnet/minecraft/class_1297;<init>(Lnet/minecraft/class_1299;Lnet/minecraft/class_1937;)Vofficial <init>Lbsr;<init>(Lbsx;Ldcw;)V
-
-
Method Details
-
setOwner
- Mappings:
Namespace Name Mixin selector named setOwnerLnet/minecraft/entity/projectile/ProjectileEntity;setOwner(Lnet/minecraft/entity/Entity;)Vintermediary method_7432Lnet/minecraft/class_1676;method_7432(Lnet/minecraft/class_1297;)Vofficial cLcnp;c(Lbsr;)V
-
getOwner
-
getEffectCause
Returns 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 named getEffectCauseLnet/minecraft/entity/projectile/ProjectileEntity;getEffectCause()Lnet/minecraft/entity/Entity;intermediary method_37225Lnet/minecraft/class_1676;method_37225()Lnet/minecraft/class_1297;official HLcnp;H()Lbsr;
-
writeCustomDataToNbt
Writes custom data tonbt. Subclasses have 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 classEntity- See Also:
- Mappings:
Namespace Name Mixin selector named writeCustomDataToNbtLnet/minecraft/entity/Entity;writeCustomDataToNbt(Lnet/minecraft/nbt/NbtCompound;)Vintermediary method_5652Lnet/minecraft/class_1297;method_5652(Lnet/minecraft/class_2487;)Vofficial bLbsr;b(Lub;)V
-
isOwner
- Mappings:
Namespace Name Mixin selector named isOwnerLnet/minecraft/entity/projectile/ProjectileEntity;isOwner(Lnet/minecraft/entity/Entity;)Zintermediary method_34714Lnet/minecraft/class_1676;method_34714(Lnet/minecraft/class_1297;)Zofficial eLcnp;e(Lbsr;)Z
-
readCustomDataFromNbt
Reads custom data fromnbt. Subclasses have 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 classEntity- See Also:
- Mappings:
Namespace Name Mixin selector named readCustomDataFromNbtLnet/minecraft/entity/Entity;readCustomDataFromNbt(Lnet/minecraft/nbt/NbtCompound;)Vintermediary method_5749Lnet/minecraft/class_1297;method_5749(Lnet/minecraft/class_2487;)Vofficial aLbsr;a(Lub;)V
-
copyFrom
Copies serializable data and nether portal data fromoriginal. -
tick
public void tick()Ticks this entity.- Overrides:
tickin classEntity- See Also:
- API Note:
- This can be overridden to add additional logics.
super.tick();should be called in those cases. - Implementation Note:
- By default, this delegates all logics to
Entity.baseTick(). - Mappings:
Namespace Name Mixin selector named tickLnet/minecraft/entity/Entity;tick()Vintermediary method_5773Lnet/minecraft/class_1297;method_5773()Vofficial lLbsr;l()V
-
shouldLeaveOwner
private boolean shouldLeaveOwner()- Mappings:
Namespace Name Mixin selector named shouldLeaveOwnerLnet/minecraft/entity/projectile/ProjectileEntity;shouldLeaveOwner()Zintermediary method_26961Lnet/minecraft/class_1676;method_26961()Zofficial tLcnp;t()Z
-
calculateVelocity
- Mappings:
Namespace Name Mixin selector named calculateVelocityLnet/minecraft/entity/projectile/ProjectileEntity;calculateVelocity(DDDFF)Lnet/minecraft/util/math/Vec3d;intermediary method_58645Lnet/minecraft/class_1676;method_58645(DDDFF)Lnet/minecraft/class_243;official dLcnp;d(DDDFF)Lexc;
-
setVelocity
public void setVelocity(double x, double y, double z, float power, float uncertainty) 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 vectory- the Y component of the direction vectorz- the Z component of the direction vectorpower- the speeduncertainty- 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 named setVelocityLnet/minecraft/entity/projectile/ProjectileEntity;setVelocity(DDDFF)Vintermediary method_7485Lnet/minecraft/class_1676;method_7485(DDDFF)Vofficial cLcnp;c(DDDFF)V
-
setVelocity
public 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 projectilepitch- the pitchyaw- the yawroll- the rollspeed- the speeddivergence- 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 named setVelocityLnet/minecraft/entity/projectile/ProjectileEntity;setVelocity(Lnet/minecraft/entity/Entity;FFFFF)Vintermediary method_24919Lnet/minecraft/class_1676;method_24919(Lnet/minecraft/class_1297;FFFFF)Vofficial aLcnp;a(Lbsr;FFFFF)V
-
hitOrDeflect
- Mappings:
Namespace Name Mixin selector named hitOrDeflectLnet/minecraft/entity/projectile/ProjectileEntity;hitOrDeflect(Lnet/minecraft/util/hit/HitResult;)Lnet/minecraft/entity/ProjectileDeflection;intermediary method_59860Lnet/minecraft/class_1676;method_59860(Lnet/minecraft/class_239;)Lnet/minecraft/class_9109;official bLcnp;b(Lexa;)Lcnq;
-
deflect
public boolean deflect(ProjectileDeflection deflection, @Nullable @Nullable Entity deflector, @Nullable @Nullable Entity owner, boolean fromAttack) - Mappings:
Namespace Name Mixin selector named deflectLnet/minecraft/entity/projectile/ProjectileEntity;deflect(Lnet/minecraft/entity/ProjectileDeflection;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/Entity;Z)Zintermediary method_59859Lnet/minecraft/class_1676;method_59859(Lnet/minecraft/class_9109;Lnet/minecraft/class_1297;Lnet/minecraft/class_1297;Z)Zofficial aLcnp;a(Lcnq;Lbsr;Lbsr;Z)Z
-
onDeflected
- Mappings:
Namespace Name Mixin selector named onDeflectedLnet/minecraft/entity/projectile/ProjectileEntity;onDeflected(Lnet/minecraft/entity/Entity;Z)Vintermediary method_59525Lnet/minecraft/class_1676;method_59525(Lnet/minecraft/class_1297;Z)Vofficial bLcnp;b(Lbsr;Z)V
-
onCollision
- Mappings:
Namespace Name Mixin selector named onCollisionLnet/minecraft/entity/projectile/ProjectileEntity;onCollision(Lnet/minecraft/util/hit/HitResult;)Vintermediary method_7488Lnet/minecraft/class_1676;method_7488(Lnet/minecraft/class_239;)Vofficial aLcnp;a(Lexa;)V
-
onEntityHit
- Mappings:
Namespace Name Mixin selector named onEntityHitLnet/minecraft/entity/projectile/ProjectileEntity;onEntityHit(Lnet/minecraft/util/hit/EntityHitResult;)Vintermediary method_7454Lnet/minecraft/class_1676;method_7454(Lnet/minecraft/class_3966;)Vofficial aLcnp;a(Lewz;)V
-
onBlockHit
- Mappings:
Namespace Name Mixin selector named onBlockHitLnet/minecraft/entity/projectile/ProjectileEntity;onBlockHit(Lnet/minecraft/util/hit/BlockHitResult;)Vintermediary method_24920Lnet/minecraft/class_1676;method_24920(Lnet/minecraft/class_3965;)Vofficial aLcnp;a(Lewy;)V
-
setVelocityClient
public void setVelocityClient(double x, double y, double z) - Overrides:
setVelocityClientin classEntity- Mappings:
Namespace Name Mixin selector named setVelocityClientLnet/minecraft/entity/Entity;setVelocityClient(DDD)Vintermediary method_5750Lnet/minecraft/class_1297;method_5750(DDD)Vofficial lLbsr;l(DDD)V
-
canHit
- Mappings:
Namespace Name Mixin selector named canHitLnet/minecraft/entity/projectile/ProjectileEntity;canHit(Lnet/minecraft/entity/Entity;)Zintermediary method_26958Lnet/minecraft/class_1676;method_26958(Lnet/minecraft/class_1297;)Zofficial bLcnp;b(Lbsr;)Z
-
updateRotation
protected void updateRotation()- Mappings:
Namespace Name Mixin selector named updateRotationLnet/minecraft/entity/projectile/ProjectileEntity;updateRotation()Vintermediary method_26962Lnet/minecraft/class_1676;method_26962()Vofficial ILcnp;I()V
-
updateRotation
protected static float updateRotation(float prevRot, float newRot) - Mappings:
Namespace Name Mixin selector named updateRotationLnet/minecraft/entity/projectile/ProjectileEntity;updateRotation(FF)Fintermediary method_26960Lnet/minecraft/class_1676;method_26960(FF)Fofficial eLcnp;e(FF)F
-
createSpawnPacket
Returns a packet to notify the clients of the entity's spawning.- Overrides:
createSpawnPacketin classEntity- Returns:
- a packet to notify the clients of the entity's spawning
- API Note:
- Subclasses should return
new EntitySpawnS2CPacket(this), unless they use a custom spawning packet. - Mappings:
Namespace Name Mixin selector named createSpawnPacketLnet/minecraft/entity/Entity;createSpawnPacket(Lnet/minecraft/server/network/EntityTrackerEntry;)Lnet/minecraft/network/packet/Packet;intermediary method_18002Lnet/minecraft/class_1297;method_18002(Lnet/minecraft/class_3231;)Lnet/minecraft/class_2596;official aLbsr;a(Laqt;)Lzg;
-
onSpawnPacket
Called 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 classEntity- Mappings:
Namespace Name Mixin selector named onSpawnPacketLnet/minecraft/entity/Entity;onSpawnPacket(Lnet/minecraft/network/packet/s2c/play/EntitySpawnS2CPacket;)Vintermediary method_31471Lnet/minecraft/class_1297;method_31471(Lnet/minecraft/class_2604;)Vofficial aLbsr;a(Labv;)V
-
canModifyAt
Returns 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 classEntity- Returns:
- whether the entity can modify the world at
pos - See Also:
- Mappings:
Namespace Name Mixin selector named canModifyAtLnet/minecraft/entity/Entity;canModifyAt(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Zintermediary method_36971Lnet/minecraft/class_1297;method_36971(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Zofficial aLbsr;a(Ldcw;Ljd;)Z
-
canBreakBlocks
- Mappings:
Namespace Name Mixin selector named canBreakBlocksLnet/minecraft/entity/projectile/ProjectileEntity;canBreakBlocks(Lnet/minecraft/world/World;)Zintermediary method_54457Lnet/minecraft/class_1676;method_54457(Lnet/minecraft/class_1937;)Zofficial bLcnp;b(Ldcw;)Z
-
canHit
public boolean canHit()Returns whether the entity can be hit with a projectile or be targeted by the player crosshair.- Overrides:
canHitin classEntity- Returns:
- whether the entity can be hit with a projectile or be targeted by the player crosshair
- Mappings:
Namespace Name Mixin selector named canHitLnet/minecraft/entity/Entity;canHit()Zintermediary method_5863Lnet/minecraft/class_1297;method_5863()Zofficial bALbsr;bA()Z
-
getTargetingMargin
public float getTargetingMargin()Returns the margin around the entity's bounding box where the entity targeting is still successful.- Overrides:
getTargetingMarginin classEntity- Returns:
- the margin around the entity's bounding box where the entity targeting is still successful
- API Note:
ExplosiveProjectileEntityoverrides this method to return1.0f, which expands the ghast fireball's effective hitbox.- Mappings:
Namespace Name Mixin selector named getTargetingMarginLnet/minecraft/entity/Entity;getTargetingMargin()Fintermediary method_5871Lnet/minecraft/class_1297;method_5871()Fofficial bLLbsr;bL()F
-
getKnockback
- Mappings:
Namespace Name Mixin selector named getKnockbackLnet/minecraft/entity/projectile/ProjectileEntity;getKnockback(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/damage/DamageSource;)Lit/unimi/dsi/fastutil/doubles/DoubleDoubleImmutablePair;intermediary method_59959Lnet/minecraft/class_1676;method_59959(Lnet/minecraft/class_1309;Lnet/minecraft/class_1282;)Lit/unimi/dsi/fastutil/doubles/DoubleDoubleImmutablePair;official a_Lcnp;a_(Lbtn;Lbrk;)Lit/unimi/dsi/fastutil/doubles/DoubleDoubleImmutablePair;
-