Class ProjectileEntity
- All Implemented Interfaces:
DataTracked
,Ownable
,ScoreHolder
,Nameable
,EntityLike
- Direct Known Subclasses:
ExplosiveProjectileEntity
,FireworkRocketEntity
,FishingBobberEntity
,LlamaSpitEntity
,PersistentProjectileEntity
,ShulkerBulletEntity
,ThrownEntity
- Mappings:
Namespace Name named net/minecraft/entity/projectile/ProjectileEntity
intermediary net/minecraft/class_1676
official cqp
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Nested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.MoveEffect, Entity.PositionUpdater, Entity.RemovalReason
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private boolean
Fields inherited from class net.minecraft.entity.Entity
age, collidedSoftly, dataTracker, DEFAULT_FRICTION, DEFAULT_MIN_FREEZE_DAMAGE_TICKS, DEFAULT_PORTAL_COOLDOWN, distanceTraveled, fallDistance, field_44870, field_44871, field_44872, field_49073, field_49791, firstUpdate, FLAGS, fluidHeight, FREEZING_DAMAGE_INTERVAL, GLIDING_FLAG_INDEX, GLOWING_FLAG_INDEX, groundCollision, horizontalCollision, ID_KEY, 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, prevPitch, prevX, prevY, prevYaw, prevZ, random, ridingCooldown, speed, submergedInWater, supportingBlockPos, timeUntilRegen, touchingWater, uuid, UUID_KEY, uuidString, velocityDirty, velocityModified, verticalCollision, wasInPowderSnow
Fields inherited from interface net.minecraft.scoreboard.ScoreHolder
WILDCARD, WILDCARD_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncalculateVelocity
(double x, double y, double z, float power, float uncertainty) boolean
canBreakBlocks
(ServerWorld world) boolean
canHit()
Returns whether the entity can be hit with a projectile or be targeted by the player crosshair.protected boolean
boolean
canModifyAt
(ServerWorld world, BlockPos pos) Returns whether the entity can modify the world atpos
.void
Copies serializable data and nether portal data fromoriginal
.createSpawnPacket
(EntityTrackerEntry entityTrackerEntry) Returns a packet to notify the clients of the entity's spawning.boolean
damage
(ServerWorld world, DamageSource source, float amount) Applies a damage to this entity.boolean
deflect
(ProjectileDeflection deflection, @Nullable Entity deflector, @Nullable Entity owner, boolean fromAttack) protected boolean
int
Returns the entity's default portal cooldown.Returns the cause entity of any effect applied by this projectile.getKnockback
(LivingEntity target, DamageSource source) getOwner()
float
Returns the margin around the entity's bounding box where the entity targeting is still successful.protected ProjectileDeflection
hitOrDeflect
(HitResult hitResult) protected boolean
protected void
onBlockHit
(BlockHitResult blockHitResult) protected void
protected void
onCollision
(HitResult hitResult) protected void
onDeflected
(@Nullable Entity deflector, boolean fromAttack) protected void
onEntityHit
(EntityHitResult entityHitResult) void
onSpawnPacket
(EntitySpawnS2CPacket packet) Called on the client when the entity receives a spawn packet.protected void
Reads custom data fromnbt
.protected void
void
void
setVelocity
(double x, double y, double z, float power, float uncertainty) Sets velocity and updates rotation accordingly.void
setVelocity
(Entity shooter, float pitch, float yaw, float roll, float speed, float divergence) Sets velocity and updates rotation accordingly.void
setVelocityClient
(double x, double y, double z) private boolean
static <T extends ProjectileEntity>
Tspawn
(T projectile, ServerWorld world, ItemStack projectileStack) static <T extends ProjectileEntity>
Tspawn
(T projectile, ServerWorld world, ItemStack projectileStack, Consumer<T> beforeSpawn) static <T extends ProjectileEntity>
TspawnWithVelocity
(ProjectileEntity.ProjectileCreator<T> creator, ServerWorld world, ItemStack projectileStack, LivingEntity shooter, double velocityX, double velocityY, double velocityZ, float power, float divergence) static <T extends ProjectileEntity>
TspawnWithVelocity
(ProjectileEntity.ProjectileCreator<T> creator, ServerWorld world, ItemStack projectileStack, LivingEntity shooter, float roll, float power, float divergence) static <T extends ProjectileEntity>
TspawnWithVelocity
(T projectile, ServerWorld world, ItemStack projectileStack, double velocityX, double velocityY, double velocityZ, float power, float divergence) void
tick()
Ticks this entity.void
triggerProjectileSpawned
(ServerWorld world, ItemStack projectileStack) protected void
protected static float
updateRotation
(float prevRot, float newRot) protected void
Writes 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, checkDespawn, clientDamage, collidesWith, collidesWithStateAtPos, copyPositionAndRotation, couldAcceptPassenger, 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, 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, getLastRenderPos, getLeashOffset, getLeashOffset, getLeashPos, getLerpedPitch, getLerpedPos, getLerpedYaw, getLerpTargetPitch, getLerpTargetX, getLerpTargetY, getLerpTargetYaw, getLerpTargetZ, getLootTableKey, getMaxAir, getMinFreezeDamageTicks, getMoveEffect, getMovement, getMovementDirection, getName, getNameForScoreboard, getOppositeRotationVector, getOppositeRotationVector, getParticleX, getParticleZ, getPassengerAttachmentPos, getPassengerAttachmentPos, getPassengerDismountOffset, getPassengerList, getPassengerRidingPos, getPassengersDeep, 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, getWeaponStack, getWidth, getWorld, getWorldSpawnPos, getX, getY, getYaw, getYaw, getZ, handleAttack, handleFallDamage, handleStatus, hasCollidedSoftly, hasControllingPassenger, hasCustomName, hashCode, hasNoGravity, hasPassenger, hasPassenger, hasPassengerDeep, hasPassengers, hasPlayerRider, hasPortalCooldown, hasVehicle, initDataTracker, interact, interactAt, isAlive, isAlwaysInvulnerableTo, isAttackable, isCollidable, isConnectedThroughVehicle, isControlledByPlayer, isCrawling, isCustomNameVisible, isDescending, isFireImmune, isFlappingWings, isFrozen, isGlowing, isGlowingLocal, isImmuneToExplosion, isInFluid, isInLava, isInPose, isInRange, isInRange, isInSameTeam, isInsideWall, isInsideWaterOrBubbleColumn, isInSneakingPose, isInSwimmingPose, isInvisible, isInvisibleTo, isInvulnerable, isLiving, isLocalPlayerOrLogicalSideForUpdatingMovement, 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, movementInputToVelocity, occludeVibrationSignals, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onDamaged, onDataTrackerUpdate, onExplodedBy, onKilledOther, onLanding, onPassengerLookAround, onPlayerCollision, onRemove, onRemoved, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, onSwimmingStart, onTrackedDataSet, playCombinationStepSounds, playExtinguishSound, playSecondaryStepSound, playSound, playSoundIfNotSilent, playStepSound, playSwimSound, playSwimSound, populateCrashReport, positionInPortal, pushAwayFrom, pushOutOfBlocks, queueBlockCollisionCheck, raycast, readNbt, recalculateDimensions, refreshPosition, refreshPositionAfterTeleport, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, refreshPositionAndAngles, reinitDimensions, remove, removeAllPassengers, removeCommandTag, removeFromDimension, removePassenger, requestTeleport, requestTeleportAndDismount, requestTeleportOffset, resetLerp, resetPortalCooldown, resetPosition, rotate, saveNbt, saveSelfNbt, scheduleVelocityUpdate, serverDamage, setAir, setAngles, setBodyYaw, setBoundingBox, setChangeListener, setCustomName, setCustomNameVisible, setFireTicks, setFlag, setFrozenTicks, setGlowing, setHeadYaw, setId, setInPowderSnow, setInvisible, setInvulnerable, setMovement, setNoGravity, setOnFire, setOnFireFor, setOnFireForTicks, setOnFireFromLava, setOnGround, setPitch, setPortalCooldown, setPos, setPose, setPosition, setPosition, setPosition, setPrevPositionAndAngles, setRemoved, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSprinting, setSwimming, setUuid, setVelocity, setVelocity, setWorld, setYaw, shouldControlVehicles, shouldDismountUnderwater, shouldEscapePowderSnow, shouldPlayBurnSoundInLava, shouldRender, shouldRender, shouldRenderName, shouldSave, shouldSetPositionOnLoad, shouldSpawnSprintingParticles, shouldTickBlockCollision, sidedDamage, slowMovement, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, startRiding, startRiding, stopRiding, streamPassengersAndSelf, streamSelfAndPassengers, teleport, teleportTo, tickBlockCollision, tickBlockCollision, tickInVoid, tickPortalCooldown, tickPortalTeleportation, tickRiding, toNbtList, toNbtList, toString, tryUsePortal, unsetRemoved, updateEventHandler, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePassengerPosition, updatePosition, updatePositionAndAngles, updatePrevAngles, updatePrevPosition, updateSupportingBlockPos, updateSwimming, updateTrackedHeadRotation, updateTrackedPosition, updateTrackedPositionAndAngles, updateVelocity, updateWaterState, writeNbt
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.scoreboard.ScoreHolder
getStyledDisplayName
-
Field Details
-
ownerUuid
- Mappings:
Namespace Name Mixin selector named ownerUuid
Lnet/minecraft/entity/projectile/ProjectileEntity;ownerUuid:Ljava/util/UUID;
intermediary field_22478
Lnet/minecraft/class_1676;field_22478:Ljava/util/UUID;
official a
Lcqp;a:Ljava/util/UUID;
-
owner
- Mappings:
Namespace Name Mixin selector named owner
Lnet/minecraft/entity/projectile/ProjectileEntity;owner:Lnet/minecraft/entity/Entity;
intermediary field_33399
Lnet/minecraft/class_1676;field_33399:Lnet/minecraft/class_1297;
official b
Lcqp;b:Lbvj;
-
leftOwner
private boolean leftOwner- Mappings:
Namespace Name Mixin selector named leftOwner
Lnet/minecraft/entity/projectile/ProjectileEntity;leftOwner:Z
intermediary field_23740
Lnet/minecraft/class_1676;field_23740:Z
official c
Lcqp;c:Z
-
shot
private boolean shot- Mappings:
Namespace Name Mixin selector named shot
Lnet/minecraft/entity/projectile/ProjectileEntity;shot:Z
intermediary field_28646
Lnet/minecraft/class_1676;field_28646:Z
official d
Lcqp;d:Z
-
lastDeflectedEntity
- Mappings:
Namespace Name Mixin selector named lastDeflectedEntity
Lnet/minecraft/entity/projectile/ProjectileEntity;lastDeflectedEntity:Lnet/minecraft/entity/Entity;
intermediary field_51621
Lnet/minecraft/class_1676;field_51621:Lnet/minecraft/class_1297;
official e
Lcqp;e:Lbvj;
-
-
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;)V
intermediary <init>
Lnet/minecraft/class_1297;<init>(Lnet/minecraft/class_1299;Lnet/minecraft/class_1937;)V
official <init>
Lbvj;<init>(Lbvq;Ldhh;)V
-
-
Method Details
-
setOwner
- Mappings:
Namespace Name Mixin selector named setOwner
Lnet/minecraft/entity/projectile/ProjectileEntity;setOwner(Lnet/minecraft/entity/Entity;)V
intermediary method_7432
Lnet/minecraft/class_1676;method_7432(Lnet/minecraft/class_1297;)V
official c
Lcqp;c(Lbvj;)V
-
getOwner
-
getEntity
- Mappings:
Namespace Name Mixin selector named getEntity
Lnet/minecraft/entity/projectile/ProjectileEntity;getEntity(Ljava/util/UUID;)Lnet/minecraft/entity/Entity;
intermediary method_61555
Lnet/minecraft/class_1676;method_61555(Ljava/util/UUID;)Lnet/minecraft/class_1297;
official b
Lcqp;b(Ljava/util/UUID;)Lbvj;
-
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 getEffectCause
Lnet/minecraft/entity/projectile/ProjectileEntity;getEffectCause()Lnet/minecraft/entity/Entity;
intermediary method_37225
Lnet/minecraft/class_1676;method_37225()Lnet/minecraft/class_1297;
official E
Lcqp;E()Lbvj;
-
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:
writeCustomDataToNbt
in classEntity
- See Also:
- Mappings:
Namespace Name Mixin selector named writeCustomDataToNbt
Lnet/minecraft/entity/Entity;writeCustomDataToNbt(Lnet/minecraft/nbt/NbtCompound;)V
intermediary method_5652
Lnet/minecraft/class_1297;method_5652(Lnet/minecraft/class_2487;)V
official b
Lbvj;b(Lux;)V
-
isOwner
- Mappings:
Namespace Name Mixin selector named isOwner
Lnet/minecraft/entity/projectile/ProjectileEntity;isOwner(Lnet/minecraft/entity/Entity;)Z
intermediary method_34714
Lnet/minecraft/class_1676;method_34714(Lnet/minecraft/class_1297;)Z
official e
Lcqp;e(Lbvj;)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.
nbt
might 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:
readCustomDataFromNbt
in classEntity
- See Also:
- Mappings:
Namespace Name Mixin selector named readCustomDataFromNbt
Lnet/minecraft/entity/Entity;readCustomDataFromNbt(Lnet/minecraft/nbt/NbtCompound;)V
intermediary method_5749
Lnet/minecraft/class_1297;method_5749(Lnet/minecraft/class_2487;)V
official a
Lbvj;a(Lux;)V
-
setOwner
- Mappings:
Namespace Name Mixin selector named setOwner
Lnet/minecraft/entity/projectile/ProjectileEntity;setOwner(Ljava/util/UUID;)V
intermediary method_64180
Lnet/minecraft/class_1676;method_64180(Ljava/util/UUID;)V
official c
Lcqp;c(Ljava/util/UUID;)V
-
copyFrom
Copies serializable data and nether portal data fromoriginal
. -
tick
public void tick()Ticks this entity.- Overrides:
tick
in 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 tick
Lnet/minecraft/entity/Entity;tick()V
intermediary method_5773
Lnet/minecraft/class_1297;method_5773()V
official h
Lbvj;h()V
-
shouldLeaveOwner
private boolean shouldLeaveOwner()- Mappings:
Namespace Name Mixin selector named shouldLeaveOwner
Lnet/minecraft/entity/projectile/ProjectileEntity;shouldLeaveOwner()Z
intermediary method_26961
Lnet/minecraft/class_1676;method_26961()Z
official m
Lcqp;m()Z
-
calculateVelocity
- Mappings:
Namespace Name Mixin selector named calculateVelocity
Lnet/minecraft/entity/projectile/ProjectileEntity;calculateVelocity(DDDFF)Lnet/minecraft/util/math/Vec3d;
intermediary method_58645
Lnet/minecraft/class_1676;method_58645(DDDFF)Lnet/minecraft/class_243;
official d
Lcqp;d(DDDFF)Lfbx;
-
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 setVelocity
Lnet/minecraft/entity/projectile/ProjectileEntity;setVelocity(DDDFF)V
intermediary method_7485
Lnet/minecraft/class_1676;method_7485(DDDFF)V
official c
Lcqp;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 setVelocity
Lnet/minecraft/entity/projectile/ProjectileEntity;setVelocity(Lnet/minecraft/entity/Entity;FFFFF)V
intermediary method_24919
Lnet/minecraft/class_1676;method_24919(Lnet/minecraft/class_1297;FFFFF)V
official a
Lcqp;a(Lbvj;FFFFF)V
-
spawnWithVelocity
public static <T extends ProjectileEntity> T spawnWithVelocity(ProjectileEntity.ProjectileCreator<T> creator, ServerWorld world, ItemStack projectileStack, LivingEntity shooter, float roll, float power, float divergence) - Mappings:
Namespace Name Mixin selector named spawnWithVelocity
Lnet/minecraft/entity/projectile/ProjectileEntity;spawnWithVelocity(Lnet/minecraft/entity/projectile/ProjectileEntity$ProjectileCreator;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;FFF)Lnet/minecraft/entity/projectile/ProjectileEntity;
intermediary method_61549
Lnet/minecraft/class_1676;method_61549(Lnet/minecraft/class_1676$class_9876;Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;FFF)Lnet/minecraft/class_1676;
official a
Lcqp;a(Lcqp$a;Lash;Lcxo;Lbwf;FFF)Lcqp;
-
spawnWithVelocity
public static <T extends ProjectileEntity> T spawnWithVelocity(ProjectileEntity.ProjectileCreator<T> creator, ServerWorld world, ItemStack projectileStack, LivingEntity shooter, double velocityX, double velocityY, double velocityZ, float power, float divergence) - Mappings:
Namespace Name Mixin selector named spawnWithVelocity
Lnet/minecraft/entity/projectile/ProjectileEntity;spawnWithVelocity(Lnet/minecraft/entity/projectile/ProjectileEntity$ProjectileCreator;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;DDDFF)Lnet/minecraft/entity/projectile/ProjectileEntity;
intermediary method_61548
Lnet/minecraft/class_1676;method_61548(Lnet/minecraft/class_1676$class_9876;Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;DDDFF)Lnet/minecraft/class_1676;
official a
Lcqp;a(Lcqp$a;Lash;Lcxo;Lbwf;DDDFF)Lcqp;
-
spawnWithVelocity
public static <T extends ProjectileEntity> T spawnWithVelocity(T projectile, ServerWorld world, ItemStack projectileStack, double velocityX, double velocityY, double velocityZ, float power, float divergence) - Mappings:
Namespace Name Mixin selector named spawnWithVelocity
Lnet/minecraft/entity/projectile/ProjectileEntity;spawnWithVelocity(Lnet/minecraft/entity/projectile/ProjectileEntity;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;DDDFF)Lnet/minecraft/entity/projectile/ProjectileEntity;
intermediary method_61552
Lnet/minecraft/class_1676;method_61552(Lnet/minecraft/class_1676;Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;DDDFF)Lnet/minecraft/class_1676;
official a
Lcqp;a(Lcqp;Lash;Lcxo;DDDFF)Lcqp;
-
spawn
public static <T extends ProjectileEntity> T spawn(T projectile, ServerWorld world, ItemStack projectileStack) - Mappings:
Namespace Name Mixin selector named spawn
Lnet/minecraft/entity/projectile/ProjectileEntity;spawn(Lnet/minecraft/entity/projectile/ProjectileEntity;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/entity/projectile/ProjectileEntity;
intermediary method_61551
Lnet/minecraft/class_1676;method_61551(Lnet/minecraft/class_1676;Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1676;
official a
Lcqp;a(Lcqp;Lash;Lcxo;)Lcqp;
-
spawn
public static <T extends ProjectileEntity> T spawn(T projectile, ServerWorld world, ItemStack projectileStack, Consumer<T> beforeSpawn) - Mappings:
Namespace Name Mixin selector named spawn
Lnet/minecraft/entity/projectile/ProjectileEntity;spawn(Lnet/minecraft/entity/projectile/ProjectileEntity;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Ljava/util/function/Consumer;)Lnet/minecraft/entity/projectile/ProjectileEntity;
intermediary method_61553
Lnet/minecraft/class_1676;method_61553(Lnet/minecraft/class_1676;Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Ljava/util/function/Consumer;)Lnet/minecraft/class_1676;
official a
Lcqp;a(Lcqp;Lash;Lcxo;Ljava/util/function/Consumer;)Lcqp;
-
triggerProjectileSpawned
- Mappings:
Namespace Name Mixin selector named triggerProjectileSpawned
Lnet/minecraft/entity/projectile/ProjectileEntity;triggerProjectileSpawned(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;)V
intermediary method_61546
Lnet/minecraft/class_1676;method_61546(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;)V
official b
Lcqp;b(Lash;Lcxo;)V
-
hitOrDeflect
- Mappings:
Namespace Name Mixin selector named hitOrDeflect
Lnet/minecraft/entity/projectile/ProjectileEntity;hitOrDeflect(Lnet/minecraft/util/hit/HitResult;)Lnet/minecraft/entity/ProjectileDeflection;
intermediary method_59860
Lnet/minecraft/class_1676;method_59860(Lnet/minecraft/class_239;)Lnet/minecraft/class_9109;
official b
Lcqp;b(Lfbv;)Lcqq;
-
deflectsAgainstWorldBorder
protected boolean deflectsAgainstWorldBorder()- Mappings:
Namespace Name Mixin selector named deflectsAgainstWorldBorder
Lnet/minecraft/entity/projectile/ProjectileEntity;deflectsAgainstWorldBorder()Z
intermediary method_62823
Lnet/minecraft/class_1676;method_62823()Z
official C
Lcqp;C()Z
-
deflect
public boolean deflect(ProjectileDeflection deflection, @Nullable @Nullable Entity deflector, @Nullable @Nullable Entity owner, boolean fromAttack) - Mappings:
Namespace Name Mixin selector named deflect
Lnet/minecraft/entity/projectile/ProjectileEntity;deflect(Lnet/minecraft/entity/ProjectileDeflection;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/Entity;Z)Z
intermediary method_59859
Lnet/minecraft/class_1676;method_59859(Lnet/minecraft/class_9109;Lnet/minecraft/class_1297;Lnet/minecraft/class_1297;Z)Z
official a
Lcqp;a(Lcqq;Lbvj;Lbvj;Z)Z
-
onDeflected
- Mappings:
Namespace Name Mixin selector named onDeflected
Lnet/minecraft/entity/projectile/ProjectileEntity;onDeflected(Lnet/minecraft/entity/Entity;Z)V
intermediary method_59525
Lnet/minecraft/class_1676;method_59525(Lnet/minecraft/class_1297;Z)V
official b
Lcqp;b(Lbvj;Z)V
-
onBroken
- Mappings:
Namespace Name Mixin selector named onBroken
Lnet/minecraft/entity/projectile/ProjectileEntity;onBroken(Lnet/minecraft/item/Item;)V
intermediary method_61544
Lnet/minecraft/class_1676;method_61544(Lnet/minecraft/class_1792;)V
official b
Lcqp;b(Lcxk;)V
-
onCollision
- Mappings:
Namespace Name Mixin selector named onCollision
Lnet/minecraft/entity/projectile/ProjectileEntity;onCollision(Lnet/minecraft/util/hit/HitResult;)V
intermediary method_7488
Lnet/minecraft/class_1676;method_7488(Lnet/minecraft/class_239;)V
official a
Lcqp;a(Lfbv;)V
-
onEntityHit
- Mappings:
Namespace Name Mixin selector named onEntityHit
Lnet/minecraft/entity/projectile/ProjectileEntity;onEntityHit(Lnet/minecraft/util/hit/EntityHitResult;)V
intermediary method_7454
Lnet/minecraft/class_1676;method_7454(Lnet/minecraft/class_3966;)V
official a
Lcqp;a(Lfbu;)V
-
onBlockHit
- Mappings:
Namespace Name Mixin selector named onBlockHit
Lnet/minecraft/entity/projectile/ProjectileEntity;onBlockHit(Lnet/minecraft/util/hit/BlockHitResult;)V
intermediary method_24920
Lnet/minecraft/class_1676;method_24920(Lnet/minecraft/class_3965;)V
official a
Lcqp;a(Lfbt;)V
-
setVelocityClient
public void setVelocityClient(double x, double y, double z) - Overrides:
setVelocityClient
in classEntity
- Mappings:
Namespace Name Mixin selector named setVelocityClient
Lnet/minecraft/entity/Entity;setVelocityClient(DDD)V
intermediary method_5750
Lnet/minecraft/class_1297;method_5750(DDD)V
official l
Lbvj;l(DDD)V
-
canHit
- Mappings:
Namespace Name Mixin selector named canHit
Lnet/minecraft/entity/projectile/ProjectileEntity;canHit(Lnet/minecraft/entity/Entity;)Z
intermediary method_26958
Lnet/minecraft/class_1676;method_26958(Lnet/minecraft/class_1297;)Z
official b
Lcqp;b(Lbvj;)Z
-
updateRotation
protected void updateRotation()- Mappings:
Namespace Name Mixin selector named updateRotation
Lnet/minecraft/entity/projectile/ProjectileEntity;updateRotation()V
intermediary method_26962
Lnet/minecraft/class_1676;method_26962()V
official F
Lcqp;F()V
-
updateRotation
protected static float updateRotation(float prevRot, float newRot) - Mappings:
Namespace Name Mixin selector named updateRotation
Lnet/minecraft/entity/projectile/ProjectileEntity;updateRotation(FF)F
intermediary method_26960
Lnet/minecraft/class_1676;method_26960(FF)F
official f
Lcqp;f(FF)F
-
createSpawnPacket
Returns a packet to notify the clients of the entity's spawning.- Overrides:
createSpawnPacket
in 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 createSpawnPacket
Lnet/minecraft/entity/Entity;createSpawnPacket(Lnet/minecraft/server/network/EntityTrackerEntry;)Lnet/minecraft/network/packet/Packet;
intermediary method_18002
Lnet/minecraft/class_1297;method_18002(Lnet/minecraft/class_3231;)Lnet/minecraft/class_2596;
official a
Lbvj;a(Lasf;)Laac;
-
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:
onSpawnPacket
in classEntity
- Mappings:
Namespace Name Mixin selector named onSpawnPacket
Lnet/minecraft/entity/Entity;onSpawnPacket(Lnet/minecraft/network/packet/s2c/play/EntitySpawnS2CPacket;)V
intermediary method_31471
Lnet/minecraft/class_1297;method_31471(Lnet/minecraft/class_2604;)V
official a
Lbvj;a(Lacs;)V
-
canModifyAt
Returns whether the entity can modify the world atpos
.This returns
true
for 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.ProjectileEntity
delegates 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:
canModifyAt
in classEntity
- Returns:
- whether the entity can modify the world at
pos
- See Also:
- Mappings:
Namespace Name Mixin selector named canModifyAt
Lnet/minecraft/entity/Entity;canModifyAt(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;)Z
intermediary method_36971
Lnet/minecraft/class_1297;method_36971(Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;)Z
official c
Lbvj;c(Lash;Ljh;)Z
-
canBreakBlocks
- Mappings:
Namespace Name Mixin selector named canBreakBlocks
Lnet/minecraft/entity/projectile/ProjectileEntity;canBreakBlocks(Lnet/minecraft/server/world/ServerWorld;)Z
intermediary method_54457
Lnet/minecraft/class_1676;method_54457(Lnet/minecraft/class_3218;)Z
official a
Lcqp;a(Lash;)Z
-
canHit
public boolean canHit()Returns whether the entity can be hit with a projectile or be targeted by the player crosshair.- Overrides:
canHit
in classEntity
- Returns:
- whether the entity can be hit with a projectile or be targeted by the player crosshair
- Mappings:
Namespace Name Mixin selector named canHit
Lnet/minecraft/entity/Entity;canHit()Z
intermediary method_5863
Lnet/minecraft/class_1297;method_5863()Z
official bH
Lbvj;bH()Z
-
getTargetingMargin
public float getTargetingMargin()Returns the margin around the entity's bounding box where the entity targeting is still successful.- Overrides:
getTargetingMargin
in classEntity
- Returns:
- the margin around the entity's bounding box where the entity targeting is still successful
- API Note:
ExplosiveProjectileEntity
overrides this method to return1.0f
, which expands the ghast fireball's effective hitbox.- Mappings:
Namespace Name Mixin selector named getTargetingMargin
Lnet/minecraft/entity/Entity;getTargetingMargin()F
intermediary method_5871
Lnet/minecraft/class_1297;method_5871()F
official bS
Lbvj;bS()F
-
getKnockback
- Mappings:
Namespace Name Mixin selector named getKnockback
Lnet/minecraft/entity/projectile/ProjectileEntity;getKnockback(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/damage/DamageSource;)Lit/unimi/dsi/fastutil/doubles/DoubleDoubleImmutablePair;
intermediary method_59959
Lnet/minecraft/class_1676;method_59959(Lnet/minecraft/class_1309;Lnet/minecraft/class_1282;)Lit/unimi/dsi/fastutil/doubles/DoubleDoubleImmutablePair;
official a_
Lcqp;a_(Lbwf;Lbtz;)Lit/unimi/dsi/fastutil/doubles/DoubleDoubleImmutablePair;
-
getDefaultPortalCooldown
public int getDefaultPortalCooldown()Returns the entity's default portal cooldown.This is 300 ticks by default, or 10 ticks for players.
- Overrides:
getDefaultPortalCooldown
in classEntity
- Returns:
- the entity's default portal cooldown
- See Also:
- Mappings:
Namespace Name Mixin selector named getDefaultPortalCooldown
Lnet/minecraft/entity/Entity;getDefaultPortalCooldown()I
intermediary method_5806
Lnet/minecraft/class_1297;method_5806()I
official bX
Lbvj;bX()I
-
damage
Applies a damage to this entity. The exact implementation differs between subclasses.LivingEntity
has health value, and damaging the entity decreases it. This also handles shields, extra damage to helmets for falling blocks, setting the attacker, playing hurt sound, etc.Some entities like
ItemEntity
also have health value, which the overridden method decrements. There also exist several entities, likeEndCrystalEntity
, where any damage discards the entity (perhaps with an explosion).If this is overridden, it must check the result of
invalid reference
#isInvulnerableTo
- Specified by:
damage
in classEntity
- Returns:
- whether the entity was actually damaged
- See Also:
- Mappings:
Namespace Name Mixin selector named damage
Lnet/minecraft/entity/Entity;damage(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/damage/DamageSource;F)Z
intermediary method_64397
Lnet/minecraft/class_1297;method_64397(Lnet/minecraft/class_3218;Lnet/minecraft/class_1282;F)Z
official a
Lbvj;a(Lash;Lbtz;F)Z
-