Class ProjectileEntity
- All Implemented Interfaces:
ComponentsAccess,DataTracked,Ownable,ScoreHolder,Nameable,EntityLike,UniquelyIdentifiable
- Direct Known Subclasses:
ExplosiveProjectileEntity,FireworkRocketEntity,FishingBobberEntity,LlamaSpitEntity,PersistentProjectileEntity,ShulkerBulletEntity,ThrownEntity
- Mappings:
Namespace Name named net/minecraft/entity/projectile/ProjectileEntityintermediary net/minecraft/class_1676official ctd
-
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 static final booleanprivate static final booleanprivate 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, lastPitch, lastRenderX, lastRenderY, lastRenderZ, lastX, lastY, lastYaw, lastZ, MAX_COMMAND_TAGS, MAX_RIDING_COOLDOWN, MIN_RISING_BUBBLE_COLUMN_SPEED, movementMultiplier, noClip, ON_FIRE_FLAG_INDEX, PASSENGERS_KEY, portalManager, POSE, 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 voidvoidonBubbleColumnCollision(boolean drag) Called when the entity collides with a bubble column without an air above.voidonBubbleColumnSurfaceCollision(boolean drag, BlockPos pos) Called when the entity collides with a bubble column with an air above.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.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 lastRot, 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, applyBubbleColumnEffects, applyBubbleColumnSurfaceEffects, applyGravity, applyMirror, applyRotation, attemptTickInVoid, baseTick, bypassesLandingEffects, bypassesSteppingEffects, calculateBoundingBox, calculateDefaultBoundingBox, calculateDimensions, calculateNextStepSoundDistance, canActVoluntarily, canAddPassenger, canAvoidTraps, canBeHitByProjectile, canBeSpectated, canExplosionDestroyBlock, canFreeze, canMoveVoluntarily, canSprintAsVehicle, canStartRiding, canTeleportBetween, canUsePortals, castComponentValue, changeLookDirection, checkDespawn, clientDamage, collidesWith, collidesWithStateAtPos, copyComponentFrom, copyComponentsFrom, copyComponentsFrom, copyPositionAndRotation, couldAcceptPassenger, defrost, detach, discard, dismountVehicle, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, emitGameEvent, emitGameEvent, equals, extinguish, extinguishWithSound, fall, get, 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, getInterpolator, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getLastRenderPos, getLeashOffset, getLeashOffset, getLeashPos, getLerpedPitch, getLerpedPos, getLerpedYaw, 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, handleFallDamageForPassengers, handleStatus, hasCollidedSoftly, hasControllingPassenger, hasCustomName, hashCode, hasNoGravity, hasPassenger, hasPassenger, hasPassengerDeep, hasPassengers, hasPlayerRider, hasPortalCooldown, hasVehicle, igniteByLava, initDataTracker, interact, interactAt, isAlive, isAlwaysInvulnerableTo, isAttackable, isCollidable, isConnectedThroughVehicle, isControlledByMainPlayer, isControlledByPlayer, isCrawling, isCustomNameVisible, isDescending, isFireImmune, isFlappingWings, isFrozen, isGlowing, isGlowingLocal, isImmuneToExplosion, isInFluid, isInLava, isInPose, isInRange, isInRange, isInSameTeam, isInsideWall, isInSneakingPose, isInSwimmingPose, isInterpolating, isInvisible, isInvisibleTo, isInvulnerable, isLiving, isLogicalSideForUpdatingMovement, isOnFire, isOnGround, isOnRail, isPartOf, isPlayer, isPushable, isPushedByFluids, isRegionUnloaded, isRemoved, isSilent, isSneaking, isSneaky, isSpectator, isSprinting, isSubmergedIn, isSubmergedInWater, isSupportedBy, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, kill, lerpPosAndRotation, lerpYaw, limitFallDistance, lookAt, move, movementInputToVelocity, occludeVibrationSignals, onBlockCollision, onDamaged, onDataTrackerUpdate, onExplodedBy, onKilledOther, onLanding, onPassengerLookAround, onPlayerCollision, onRemove, onRemoved, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, onSwimmingStart, onTrackedDataSet, playCombinationStepSounds, playExtinguishSound, playSecondaryStepSound, playSound, playSoundIfNotSilent, playStepSound, playSwimSound, playSwimSound, popQueuedCollisionCheck, populateCrashReport, positionInPortal, pushAwayFrom, pushOutOfBlocks, raycast, readNbt, recalculateDimensions, refreshPosition, refreshPositionAfterTeleport, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, refreshPositionAndAngles, reinitDimensions, remove, removeAllPassengers, removeCommandTag, removeFromDimension, removePassenger, requestTeleport, requestTeleportAndDismount, requestTeleportOffset, resetPortalCooldown, resetPosition, rotate, saveNbt, saveSelfNbt, scheduleVelocityUpdate, serverDamage, setAir, setAngles, setApplicableComponent, setBodyYaw, setBoundingBox, setChangeListener, setComponent, setCustomName, setCustomNameVisible, setFireTicks, setFlag, setFrozenTicks, setGlowing, setHeadYaw, setId, setInPowderSnow, setInvisible, setInvulnerable, setLastPositionAndAngles, setMovement, setMovement, setNoGravity, setOnFire, setOnFireFor, setOnFireForTicks, setOnFireFromLava, setOnGround, setPitch, setPortalCooldown, setPos, setPose, setPosition, setPosition, setPosition, 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, spawnBubbleColumnParticles, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, startRiding, startRiding, stopRiding, streamPassengersAndSelf, streamSelfAndPassengers, teleport, teleportTo, tickBlockCollision, tickBlockCollision, tickInVoid, tickPortalCooldown, tickPortalTeleportation, tickRiding, toString, tryUsePortal, unsetRemoved, updateEventHandler, updateKilledAdvancementCriterion, updateLastAngles, updateLastPosition, 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.component.ComponentsAccess
getOrDefault, getTypedMethods inherited from interface net.minecraft.scoreboard.ScoreHolder
getStyledDisplayName
-
Field Details
-
DEFAULT_LEFT_OWNER
private static final boolean DEFAULT_LEFT_OWNER- See Also:
- Mappings:
Namespace Name Mixin selector named DEFAULT_LEFT_OWNERLnet/minecraft/entity/projectile/ProjectileEntity;DEFAULT_LEFT_OWNER:Zintermediary field_57742Lnet/minecraft/class_1676;field_57742:Zofficial aLctd;a:Z
-
DEFAULT_SHOT
private static final boolean DEFAULT_SHOT- See Also:
- Mappings:
Namespace Name Mixin selector named DEFAULT_SHOTLnet/minecraft/entity/projectile/ProjectileEntity;DEFAULT_SHOT:Zintermediary field_57743Lnet/minecraft/class_1676;field_57743:Zofficial bLctd;b:Z
-
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 cLctd;c: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 dLctd;d:Lbxe;
-
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 eLctd;e: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 fLctd;f: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 gLctd;g:Lbxe;
-
-
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>Lbxe;<init>(Lbxn;Ldkj;)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 cLctd;c(Lbxe;)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 bLctd;b(Ljava/util/UUID;)Lbxe;
-
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 yLctd;y()Lbxe;
-
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 bLbxe;b(Lua;)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 eLctd;e(Lbxe;)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 aLbxe;a(Lua;)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 cLctd;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 gLbxe;g()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 fLctd;f()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 dLctd;d(DDDFF)Lfgc;
-
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 cLctd;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 aLctd;a(Lbxe;FFFFF)V
-
onBubbleColumnSurfaceCollision
Called when the entity collides with a bubble column with an air above.This applies the bubble column velocity by default.
BoatEntityuses this to spawn splash particles.- Overrides:
onBubbleColumnSurfaceCollisionin classEntity- Parameters:
drag- whether the entity should be dragged downwards- Mappings:
Namespace Name Mixin selector named onBubbleColumnSurfaceCollisionLnet/minecraft/entity/Entity;onBubbleColumnSurfaceCollision(ZLnet/minecraft/util/math/BlockPos;)Vintermediary method_5700Lnet/minecraft/class_1297;method_5700(ZLnet/minecraft/class_2338;)Vofficial aLbxe;a(ZLiw;)V
-
onBubbleColumnCollision
public void onBubbleColumnCollision(boolean drag) Called when the entity collides with a bubble column without an air above.This applies the bubble column velocity by default.
- Overrides:
onBubbleColumnCollisionin classEntity- Parameters:
drag- whether the entity should be dragged downwards- Mappings:
Namespace Name Mixin selector named onBubbleColumnCollisionLnet/minecraft/entity/Entity;onBubbleColumnCollision(Z)Vintermediary method_5764Lnet/minecraft/class_1297;method_5764(Z)Vofficial lLbxe;l(Z)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 aLctd;a(Lctd$a;Lasb;Ldak;Lbyf;FFF)Lctd;
-
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 aLctd;a(Lctd$a;Lasb;Ldak;Lbyf;DDDFF)Lctd;
-
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 aLctd;a(Lctd;Lasb;Ldak;DDDFF)Lctd;
-
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 aLctd;a(Lctd;Lasb;Ldak;)Lctd;
-
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 aLctd;a(Lctd;Lasb;Ldak;Ljava/util/function/Consumer;)Lctd;
-
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 bLctd;b(Lasb;Ldak;)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 bLctd;b(Lfga;)Lcte;
-
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 wLctd;w()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 aLctd;a(Lcte;Lbxe;Lbxe;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 cLctd;c(Lbxe;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 bLctd;b(Ldag;)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 aLctd;a(Lfga;)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 aLctd;a(Lffz;)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 aLctd;a(Lffy;)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 bLctd;b(Lbxe;)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 zLctd;z()V
-
updateRotation
protected static float updateRotation(float lastRot, 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 fLctd;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 aLbxe;a(Larz;)Lzo;
-
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 aLbxe;a(Lacg;)V
-
canModifyAt
Returns whether the entity can modify the world atpos.This returns
truefor most entities. Players checkto prevent them from modifying entities in the spawn protection or outside the world border.invalid reference
World#canPlayerModifyAtProjectileEntitydelegates 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 cLbxe;c(Lasb;Liw;)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 aLctd;a(Lasb;)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 bFLbxe;bF()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 bRLbxe;bR()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_Lctd;a_(Lbyf;Lbvt;)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 bWLbxe;bW()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
LivingEntity.isInvulnerableTo(net.minecraft.server.world.ServerWorld, net.minecraft.entity.damage.DamageSource)and return early.- 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 aLbxe;a(Lasb;Lbvt;F)Z
-