Class ProjectileEntity
- All Implemented Interfaces:
ComponentsAccess,DataTracked,Ownable,ScoreHolder,HeldItemContext,Nameable,DebugTrackable,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 dai
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceNested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.MoveEffect, Entity.PositionUpdater, Entity.RemovalReasonNested classes/interfaces inherited from interface net.minecraft.world.debug.DebugTrackable
DebugTrackable.DebugDataSupplier<T>, DebugTrackable.TrackerNested classes/interfaces inherited from interface net.minecraft.util.HeldItemContext
HeldItemContext.Offset -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate static final booleanprivate static final booleanprivate booleanprotected @Nullable LazyEntityReference<Entity> private booleanFields inherited from class net.minecraft.entity.Entity
age, AIR_KEY, collidedSoftly, CUSTOM_DATA_KEY, CUSTOM_NAME_KEY, dataTracker, DEFAULT_FRICTION, DEFAULT_MIN_FREEZE_DAMAGE_TICKS, DEFAULT_PORTAL_COOLDOWN, distanceTraveled, FALL_DISTANCE_KEY, fallDistance, field_44870, field_44871, field_44872, field_49073, field_49791, FIRE_KEY, firstUpdate, FLAGS, fluidHeight, FREEZING_DAMAGE_INTERVAL, GLIDING_FLAG_INDEX, GLOWING_FLAG_INDEX, GLOWING_KEY, groundCollision, horizontalCollision, ID_KEY, inPowderSnow, intersectionChecked, INVULNERABLE_KEY, lastPitch, lastRenderX, lastRenderY, lastRenderZ, lastX, lastY, lastYaw, lastZ, MAX_COMMAND_TAGS, MAX_QUEUED_COLLISION_CHECKS, MAX_RIDING_COOLDOWN, MIN_RISING_BUBBLE_COLUMN_SPEED, MOTION_KEY, movementMultiplier, NO_GRAVITY_KEY, noClip, ON_FIRE_FLAG_INDEX, ON_GROUND_KEY, PASSENGERS_KEY, PORTAL_COOLDOWN_KEY, portalManager, POS_KEY, POSE, random, ridingCooldown, ROTATION_KEY, SILENT_KEY, 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 LazyEntityReference<Entity> lazyEntityReference, 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.private booleanprotected 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(boolean bool) protected voidonEntityHit(EntityHitResult entityHitResult) voidonSpawnPacket(EntitySpawnS2CPacket packet) Called on the client when the entity receives a spawn packet.protected voidreadCustomData(ReadView view) voidprotected voidsetOwner(@Nullable LazyEntityReference<Entity> owner) voidsetVelocity(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.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) voidtick()Ticks this entity.protected voidvoidtriggerProjectileSpawned(ServerWorld world, ItemStack projectileStack) protected voidprotected static floatupdateRotation(float lastRot, float newRot) protected voidwriteCustomData(WriteView view) 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, calcDistanceFromBottomCollision, calculateBoundingBox, calculateDefaultBoundingBox, calculateDimensions, calculateNextStepSoundDistance, canActVoluntarily, canAddPassenger, canAvoidTraps, canBeHitByProjectile, canBeSpectated, canExplosionDestroyBlock, canFreeze, canMoveVoluntarily, canSprintAsVehicle, canStartRiding, canTeleportBetween, canUsePortals, castComponentValue, changeLookDirection, checkDespawn, clearQueuedCollisionChecks, clientDamage, collides, collidesWith, collidesWithFluid, collidesWithStateAtPos, copyComponentFrom, copyComponentsFrom, copyComponentsFrom, copyPositionAndRotation, couldAcceptPassenger, defrost, detach, detachAllHeldLeashes, discard, dismountVehicle, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropStack, dropStack, dropStack, emitGameEvent, emitGameEvent, equals, extinguish, extinguishWithSound, fall, findCollisions, 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, getEntityPos, getEntityWorld, getErrorReporterContext, getEyeHeight, getEyePos, getEyeY, getFacing, getFinalGravity, getFireTicks, getFirstPassenger, getFlag, getFluidHeight, getFreezingScale, getFrozenTicks, getGravity, getHandPosOffset, getHeadYaw, getHeight, getHeldQuadLeashOffsets, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getId, getInterpolator, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getLastRenderPos, 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, getPose, getPosWithYOffset, getProjectileDeflection, getRandom, getRandomBodyY, getRegistryManager, getRemovalReason, getRenderDistanceMultiplier, getRootVehicle, getRotationClient, getRotationVec, getRotationVecClient, getRotationVector, getRotationVector, getSafeFallDistance, getSavedEntityId, getScoreboardTeam, getSoundCategory, getSplashSound, getStackReference, getStandingEyeHeight, getStepHeight, getSteppingBlockState, getSteppingPos, getStepSoundPos, getSwimHeight, getSwimSound, getSyncedPos, getTeamColorValue, getTrackedPosition, getType, getUuid, getUuidAsString, getVehicle, getVehicleAttachmentPos, getVelocity, getVelocityAffectingPos, getVelocityMultiplier, getWeaponStack, getWidth, getWorldSpawnPos, getX, getY, getYaw, getYaw, getZ, handleAttack, handleFall, handleFallDamage, handleFallDamageForPassengers, handleStatus, hasCollidedSoftly, hasControllingPassenger, hasCustomName, hashCode, hasNoGravity, hasPassenger, hasPassenger, hasPassengerDeep, hasPassengers, hasPlayerRider, hasPortalCooldown, hasQuadLeashAttachmentPoints, hasVehicle, igniteByLava, initDataTracker, interact, interactAt, isAlive, isAlwaysInvulnerableTo, isAtCloudHeight, isAttackable, isCollidable, isConnectedThroughVehicle, isControlledByMainPlayer, isControlledByPlayer, isCrawling, isCustomNameVisible, isDescending, isFireImmune, isFlappingWings, isFlyingVehicle, isFrozen, isGlowing, isGlowingLocal, isImmuneToExplosion, isInFluid, isInLava, isInPose, isInRange, isInRange, isInSameTeam, isInsideWall, isInSneakingPose, isInSwimmingPose, isInteractable, isInterpolating, isInvisible, isInvisibleTo, isInvulnerable, isLiving, isLogicalSideForUpdatingMovement, isOnFire, isOnGround, isOnRail, isPartlyTouchingWater, 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, onHeldLeashUpdate, 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, readData, recalculateDimensions, refreshPosition, refreshPositionAfterTeleport, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, refreshPositionAndAngles, registerTracking, reinitDimensions, remove, removeAllPassengers, removeCommandTag, removeFromDimension, removePassenger, requestTeleport, requestTeleportAndDismount, requestTeleportOffset, resetPortalCooldown, resetPosition, rotate, saveData, saveSelfData, scheduleVelocityUpdate, serverDamage, setAir, setAlwaysSyncAbsolute, 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, setPosition, setRemoved, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSprinting, setSwimming, setUuid, setVelocity, setVelocity, setVelocityClient, setWorld, setYaw, shouldAlwaysSyncAbsolute, shouldControlVehicles, shouldDismountUnderwater, shouldEscapePowderSnow, shouldPlayBurnSoundInLava, shouldRender, shouldRender, shouldRenderName, shouldSave, shouldSetPositionOnLoad, shouldSpawnSprintingParticles, shouldTickBlockCollision, sidedDamage, slowMovement, snipAllHeldLeashes, spawnBubbleColumnParticles, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, startRiding, startRiding, stopRiding, streamPassengersAndSelf, streamSelfAndPassengers, teleport, teleportSpectatingPlayers, teleportTo, tickBlockCollision, tickBlockCollision, tickHeldLeash, tickInVoid, tickPortalCooldown, tickPortalTeleportation, tickRiding, toString, tryUsePortal, unsetRemoved, updateEventHandler, updateKilledAdvancementCriterion, updateLastAngles, updateLastPosition, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateSupportingBlockPos, updateSwimming, updateTrackedAngles, updateTrackedHeadRotation, updateTrackedPosition, updateTrackedPosition, updateTrackedPositionAndAngles, updateTrackedPositionAndAngles, updateVelocity, updateWaterState, writeDataMethods 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.util.HeldItemContext
getEntityMethods inherited from interface net.minecraft.util.Nameable
getStringifiedNameMethods 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 aLdai;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 bLdai;b:Z
-
owner
- Mappings:
Namespace Name Mixin selector named ownerLnet/minecraft/entity/projectile/ProjectileEntity;owner:Lnet/minecraft/entity/LazyEntityReference;intermediary field_60558Lnet/minecraft/class_1676;field_60558:Lnet/minecraft/class_10583;official eLdai;e:Lceb;
-
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 cLdai;c:Z
-
checkedForLeftOwner
private boolean checkedForLeftOwner- Mappings:
Namespace Name Mixin selector named checkedForLeftOwnerLnet/minecraft/entity/projectile/ProjectileEntity;checkedForLeftOwner:Zintermediary field_63116Lnet/minecraft/class_1676;field_63116:Zofficial dLdai;d:Z
-
shot
private boolean shot- Mappings:
Namespace Name Mixin selector named shotLnet/minecraft/entity/projectile/ProjectileEntity;shot:Zintermediary field_28646Lnet/minecraft/class_1676;field_28646:Zofficial fLdai;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 gLdai;g:Lcdv;
-
-
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>Lcdv;<init>(Lcee;Ldrq;)V
-
-
Method Details
-
setOwner
- Mappings:
Namespace Name Mixin selector named setOwnerLnet/minecraft/entity/projectile/ProjectileEntity;setOwner(Lnet/minecraft/entity/LazyEntityReference;)Vintermediary method_71623Lnet/minecraft/class_1676;method_71623(Lnet/minecraft/class_10583;)Vofficial aLdai;a(Lceb;)V
-
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 cLdai;c(Lcdv;)V
-
getOwner
-
getEffectCause
Returns the cause entity of any effect applied by this projectile. If this projectile has an owner, the effect is attributed to the owner; otherwise, it is attributed to this projectile itself.- Returns:
- the cause entity of any effect applied by this projectile
- Mappings:
Namespace Name Mixin selector named getEffectCauseLnet/minecraft/entity/projectile/ProjectileEntity;getEffectCause()Lnet/minecraft/entity/Entity;intermediary method_37225Lnet/minecraft/class_1676;method_37225()Lnet/minecraft/class_1297;official yLdai;y()Lcdv;
-
writeCustomData
- Specified by:
writeCustomDatain classEntity- Mappings:
Namespace Name Mixin selector named writeCustomDataLnet/minecraft/entity/Entity;writeCustomData(Lnet/minecraft/storage/WriteView;)Vintermediary method_5652Lnet/minecraft/class_1297;method_5652(Lnet/minecraft/class_11372;)Vofficial aLcdv;a(Lfir;)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 eLdai;e(Lcdv;)Z
-
readCustomData
- Specified by:
readCustomDatain classEntity- Mappings:
Namespace Name Mixin selector named readCustomDataLnet/minecraft/entity/Entity;readCustomData(Lnet/minecraft/storage/ReadView;)Vintermediary method_5749Lnet/minecraft/class_1297;method_5749(Lnet/minecraft/class_11368;)Vofficial aLcdv;a(Lfip;)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 gLcdv;g()V
-
tickLeftOwner
protected void tickLeftOwner()- Mappings:
Namespace Name Mixin selector named tickLeftOwnerLnet/minecraft/entity/projectile/ProjectileEntity;tickLeftOwner()Vintermediary method_26961Lnet/minecraft/class_1676;method_26961()Vofficial zLdai;z()V
-
hasLeftOwner
private boolean hasLeftOwner()- Mappings:
Namespace Name Mixin selector named hasLeftOwnerLnet/minecraft/entity/projectile/ProjectileEntity;hasLeftOwner()Zintermediary method_74960Lnet/minecraft/class_1676;method_74960()Zofficial fLdai;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 dLdai;d(DDDFF)Lfoh;
-
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 cLdai;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 aLdai;a(Lcdv;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 aLcdv;a(ZLja;)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 mLcdv;m(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 aLdai;a(Ldai$a;Lawx;Ldhp;Lcew;FFF)Ldai;
-
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 aLdai;a(Ldai$a;Lawx;Ldhp;Lcew;DDDFF)Ldai;
-
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 aLdai;a(Ldai;Lawx;Ldhp;DDDFF)Ldai;
-
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 aLdai;a(Ldai;Lawx;Ldhp;)Ldai;
-
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 aLdai;a(Ldai;Lawx;Ldhp;Ljava/util/function/Consumer;)Ldai;
-
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 bLdai;b(Lawx;Ldhp;)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 bLdai;b(Lfof;)Ldaj;
-
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 wLdai;w()Z
-
deflect
public boolean deflect(ProjectileDeflection deflection, @Nullable @Nullable Entity deflector, @Nullable @Nullable LazyEntityReference<Entity> lazyEntityReference, 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/LazyEntityReference;Z)Zintermediary method_59859Lnet/minecraft/class_1676;method_59859(Lnet/minecraft/class_9109;Lnet/minecraft/class_1297;Lnet/minecraft/class_10583;Z)Zofficial aLdai;a(Ldaj;Lcdv;Lceb;Z)Z
-
onDeflected
protected void onDeflected(boolean bool) - Mappings:
Namespace Name Mixin selector named onDeflectedLnet/minecraft/entity/projectile/ProjectileEntity;onDeflected(Z)Vintermediary method_59525Lnet/minecraft/class_1676;method_59525(Z)Vofficial b_Ldai;b_(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 bLdai;b(Ldhl;)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 aLdai;a(Lfof;)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 aLdai;a(Lfoe;)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 aLdai;a(Lfod;)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 bLdai;b(Lcdv;)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 ALdai;A()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 fLdai;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 aLcdv;a(Lawv;)Laao;
-
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 aLcdv;a(Lacs;)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 cLcdv;c(Lawx;Lja;)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 aLdai;a(Lawx;)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 bTLcdv;bT()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 ceLcdv;ce()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_Ldai;a_(Lcew;Lcci;)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 cjLcdv;cj()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 aLcdv;a(Lawx;Lcci;F)Z
-