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/ProjectileEntityintermediary net/minecraft/class_1676official cpr
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceNested 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, 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, wasInPowderSnowFields 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(ServerWorld world) booleancanHit()Returns whether the entity can be hit with a projectile or be targeted by the player crosshair.protected booleanbooleancanModifyAt(ServerWorld 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.booleandamage(ServerWorld world, DamageSource source, float amount) Applies a damage to this entity.booleandeflect(ProjectileDeflection deflection, @Nullable Entity deflector, @Nullable Entity owner, boolean fromAttack) protected booleanintReturns the entity's default portal cooldown.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 voidprotected 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.protected voidvoidvoidsetVelocity(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.private booleanstatic <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) voidtick()Ticks this entity.voidtriggerProjectileSpawned(ServerWorld world, ItemStack projectileStack) 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, calculateDefaultBoundingBox, 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, equals, extinguish, extinguishWithSound, fall, getAir, getAttachments, getBlockPos, getBlockStateAtPos, getBlockX, getBlockY, getBlockZ, getBodyX, getBodyY, getBodyYaw, getBodyZ, 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, handleFall, 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, 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, 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, setVelocityClient, 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, writeNbtMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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 aLcpr;a: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 bLcpr;b:Lbum;
-
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 cLcpr;c: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 dLcpr;d: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 eLcpr;e:Lbum;
-
-
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>Lbum;<init>(Lbut;Ldgj;)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 cLcpr;c(Lbum;)V
-
getOwner
-
getEntity
- Mappings:
Namespace Name Mixin selector named getEntityLnet/minecraft/entity/projectile/ProjectileEntity;getEntity(Ljava/util/UUID;)Lnet/minecraft/entity/Entity;intermediary method_61555Lnet/minecraft/class_1676;method_61555(Ljava/util/UUID;)Lnet/minecraft/class_1297;official bLcpr;b(Ljava/util/UUID;)Lbum;
-
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 ELcpr;E()Lbum;
-
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 bLbum;b(Ltq;)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 eLcpr;e(Lbum;)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 aLbum;a(Ltq;)V
-
setOwner
- Mappings:
Namespace Name Mixin selector named setOwnerLnet/minecraft/entity/projectile/ProjectileEntity;setOwner(Ljava/util/UUID;)Vintermediary method_64180Lnet/minecraft/class_1676;method_64180(Ljava/util/UUID;)Vofficial cLcpr;c(Ljava/util/UUID;)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 hLbum;h()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 mLcpr;m()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 dLcpr;d(DDDFF)Lfbb;
-
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 cLcpr;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 aLcpr;a(Lbum;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 spawnWithVelocityLnet/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_61549Lnet/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 aLcpr;a(Lcpr$a;Lard;Lcwq;Lbvi;FFF)Lcpr;
-
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 spawnWithVelocityLnet/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_61548Lnet/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 aLcpr;a(Lcpr$a;Lard;Lcwq;Lbvi;DDDFF)Lcpr;
-
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 spawnWithVelocityLnet/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_61552Lnet/minecraft/class_1676;method_61552(Lnet/minecraft/class_1676;Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;DDDFF)Lnet/minecraft/class_1676;official aLcpr;a(Lcpr;Lard;Lcwq;DDDFF)Lcpr;
-
spawn
public static <T extends ProjectileEntity> T spawn(T projectile, ServerWorld world, ItemStack projectileStack) - Mappings:
Namespace Name Mixin selector named spawnLnet/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_61551Lnet/minecraft/class_1676;method_61551(Lnet/minecraft/class_1676;Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1676;official aLcpr;a(Lcpr;Lard;Lcwq;)Lcpr;
-
spawn
public static <T extends ProjectileEntity> T spawn(T projectile, ServerWorld world, ItemStack projectileStack, Consumer<T> beforeSpawn) - Mappings:
Namespace Name Mixin selector named spawnLnet/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_61553Lnet/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 aLcpr;a(Lcpr;Lard;Lcwq;Ljava/util/function/Consumer;)Lcpr;
-
triggerProjectileSpawned
- Mappings:
Namespace Name Mixin selector named triggerProjectileSpawnedLnet/minecraft/entity/projectile/ProjectileEntity;triggerProjectileSpawned(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;)Vintermediary method_61546Lnet/minecraft/class_1676;method_61546(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;)Vofficial bLcpr;b(Lard;Lcwq;)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 bLcpr;b(Lfaz;)Lcps;
-
deflectsAgainstWorldBorder
protected boolean deflectsAgainstWorldBorder()- Mappings:
Namespace Name Mixin selector named deflectsAgainstWorldBorderLnet/minecraft/entity/projectile/ProjectileEntity;deflectsAgainstWorldBorder()Zintermediary method_62823Lnet/minecraft/class_1676;method_62823()Zofficial CLcpr;C()Z
-
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 aLcpr;a(Lcps;Lbum;Lbum;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 bLcpr;b(Lbum;Z)V
-
onBroken
- Mappings:
Namespace Name Mixin selector named onBrokenLnet/minecraft/entity/projectile/ProjectileEntity;onBroken(Lnet/minecraft/item/Item;)Vintermediary method_61544Lnet/minecraft/class_1676;method_61544(Lnet/minecraft/class_1792;)Vofficial bLcpr;b(Lcwm;)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 aLcpr;a(Lfaz;)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 aLcpr;a(Lfay;)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 aLcpr;a(Lfax;)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 bLcpr;b(Lbum;)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 FLcpr;F()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 fLcpr;f(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 aLbum;a(Larb;)Lyw;
-
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 aLbum;a(Labm;)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/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;)Zintermediary method_36971Lnet/minecraft/class_1297;method_36971(Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;)Zofficial cLbum;c(Lard;Lji;)Z
-
canBreakBlocks
- Mappings:
Namespace Name Mixin selector named canBreakBlocksLnet/minecraft/entity/projectile/ProjectileEntity;canBreakBlocks(Lnet/minecraft/server/world/ServerWorld;)Zintermediary method_54457Lnet/minecraft/class_1676;method_54457(Lnet/minecraft/class_3218;)Zofficial aLcpr;a(Lard;)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 bHLbum;bH()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 bSLbum;bS()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_Lcpr;a_(Lbvi;Lbtc;)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:
getDefaultPortalCooldownin classEntity- Returns:
- the entity's default portal cooldown
- See Also:
- Mappings:
Namespace Name Mixin selector named getDefaultPortalCooldownLnet/minecraft/entity/Entity;getDefaultPortalCooldown()Iintermediary method_5806Lnet/minecraft/class_1297;method_5806()Iofficial bXLbum;bX()I
-
damage
Applies a damage to this entity. The exact implementation differs between subclasses.LivingEntityhas 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
ItemEntityalso 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
and return early.invalid reference
#isInvulnerableTo- Specified by:
damagein classEntity- Returns:
- whether the entity was actually damaged
- See Also:
- Mappings:
Namespace Name Mixin selector named damageLnet/minecraft/entity/Entity;damage(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/damage/DamageSource;F)Zintermediary method_64397Lnet/minecraft/class_1297;method_64397(Lnet/minecraft/class_3218;Lnet/minecraft/class_1282;F)Zofficial aLbum;a(Lard;Lbtc;F)Z
-