Class ItemEntity
- All Implemented Interfaces:
Ownable
,CommandOutput
,Nameable
,EntityLike
- Mappings:
Namespace Name official byn
intermediary net/minecraft/class_1542
named net/minecraft/entity/ItemEntity
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.MoveEffect, Entity.PositionUpdater, Entity.RemovalReason
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private static final int
private int
private int
The number of ticks since this item entity has been created.private static final int
private int
private static final TrackedData<ItemStack>
final float
Fields inherited from class net.minecraft.entity.Entity
age, collidedSoftly, dataTracker, DEFAULT_FRICTION, DEFAULT_MIN_FREEZE_DAMAGE_TICKS, DEFAULT_PORTAL_COOLDOWN, distanceTraveled, FALL_FLYING_FLAG_INDEX, fallDistance, field_29991, field_44870, field_44871, field_44872, firstUpdate, FLAGS, fluidHeight, FREEZING_DAMAGE_INTERVAL, GLOWING_FLAG_INDEX, groundCollision, horizontalCollision, horizontalSpeed, ID_KEY, ignoreCameraFrustum, inNetherPortal, inPowderSnow, intersectionChecked, lastNetherPortalPosition, lastRenderX, lastRenderY, lastRenderZ, MAX_COMMAND_TAGS, MAX_RIDING_COOLDOWN, MIN_RISING_BUBBLE_COLUMN_SPEED, movementMultiplier, netherPortalTime, noClip, ON_FIRE_FLAG_INDEX, PASSENGERS_KEY, POSE, prevHorizontalSpeed, prevPitch, prevX, prevY, prevYaw, prevZ, random, ridingCooldown, speed, submergedInWater, supportingBlockPos, timeUntilRegen, touchingWater, uuid, UUID_KEY, uuidString, velocityDirty, velocityModified, verticalCollision, wasInPowderSnow, wasOnFire
Fields inherited from interface net.minecraft.server.command.CommandOutput
DUMMY
-
Constructor Summary
ModifierConstructorDescriptionItemEntity
(EntityType<? extends ItemEntity> type, World world) private
ItemEntity
(ItemEntity entity) ItemEntity
(World world, double x, double y, double z, ItemStack stack) ItemEntity
(World world, double x, double y, double z, ItemStack stack, double velocityX, double velocityY, double velocityZ) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
private boolean
canMerge()
static boolean
boolean
Returns whether the pickup delay of this item entity is greater than 0.copy()
boolean
damage
(DamageSource source, float amount) Applies a damage to this entity.float
Returns the body yaw of the entity.int
Returns the number of ticks since this item entity has been created.protected Entity.MoveEffect
Returns the possible effect(s) of an entity moving.getName()
Returns the name of this object.getOwner()
float
getRotation
(float tickDelta) Returns the sound category for sounds from this entity.getStack()
Returns the item stack contained in this item entity.protected BlockPos
protected void
Initializes data tracker.boolean
Returns whether the entity can be attacked by players.boolean
Returns whether the entity is immune to fire damage.private static void
merge
(ItemEntity targetEntity, ItemStack targetStack, ItemEntity sourceEntity, ItemStack sourceStack) private static void
merge
(ItemEntity targetEntity, ItemStack stack1, ItemStack stack2) static ItemStack
moveToWorld
(ServerWorld destination) Moves this entity to another world.boolean
Returns whether the entity should not emit vibrations.void
onPlayerCollision
(PlayerEntity player) Called when a player collides with the entity.void
onTrackedDataSet
(TrackedData<?> data) Called on the client when the tracked data is set.void
Reads custom data fromnbt
.void
Sets the number of ticks before this item entity can be picked up to 0.void
void
void
void
void
setPickupDelay
(int pickupDelay) Sets the number of ticks before this item entity can be picked up topickupDelay
.void
Makes this item entity impossible to be picked up by setting its pickup delay to 32767.void
Sets the item stack contained in this item entity tostack
.void
setThrower
(@Nullable UUID thrower) Sets the thrower of this item entity tothrower
.void
Sets the number of ticks before this item entity can be picked up to the default value of 10.void
tick()
Ticks this entity.private void
tryMerge()
private void
tryMerge
(ItemEntity other) void
Writes custom data tonbt
.Methods inherited from class net.minecraft.entity.Entity
addAirTravelEffects, addCommandTag, addFlapEffects, addPassenger, addVelocity, addVelocity, adjustMovementForCollisions, adjustMovementForPiston, adjustMovementForSneaking, animateDamage, applyDamageEffects, applyMirror, applyRotation, attemptTickInVoid, baseTick, bypassesLandingEffects, bypassesSteppingEffects, calculateBoundingBox, calculateDimensions, calculateNextStepSoundDistance, canAddPassenger, canAvoidTraps, canBeHitByProjectile, canBeSpectated, canExplosionDestroyBlock, canFreeze, canHit, canModifyAt, canMoveVoluntarily, canSprintAsVehicle, canStartRiding, canUsePortals, changeLookDirection, checkBlockCollision, checkDespawn, checkWaterState, collidesWith, collidesWithStateAtPos, copyFrom, copyPositionAndRotation, couldAcceptPassenger, createSpawnPacket, detach, discard, dismountVehicle, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, emitGameEvent, emitGameEvent, entityDataRequiresOperator, equals, equipStack, extinguish, extinguishWithSound, fall, getAir, getArmorItems, getBlockPos, getBlockStateAtPos, getBlockX, getBlockY, getBlockZ, getBodyY, getBoundingBox, getBrightnessAtEyes, getBurningDuration, getCameraPosVec, getChunkPos, getClientCameraPosVec, getCommandSource, getCommandTags, getControllingPassenger, getControllingVehicle, getCustomName, getDamageSources, getDataTracker, getDefaultName, getDefaultPortalCooldown, getDimensions, getDisplayName, getEffectiveExplosionResistance, getEntityName, getEntityWorld, getEyeHeight, getEyeHeight, getEyePos, getEyeY, getFireTicks, getFirstPassenger, getFlag, getFluidHeight, getFreezingScale, getFrozenTicks, getHandItems, getHandPosOffset, getHeadYaw, getHeight, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getId, getItemsEquipped, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getLeashOffset, getLeashOffset, getLeashPos, getLerpedPos, getLerpTargetPitch, getLerpTargetX, getLerpTargetY, getLerpTargetYaw, getLerpTargetZ, getMaxAir, getMaxNetherPortalTime, getMinFreezeDamageTicks, getMovementDirection, getNameLabelHeight, getOppositeRotationVector, getOppositeRotationVector, getParticleX, getParticleZ, getPassengerAttachmentPos, getPassengerDismountOffset, getPassengerList, getPassengerRidingPos, getPassengersDeep, getPermissionLevel, getPickBlockStack, getPistonBehavior, getPitch, getPitch, getPortalCooldown, getPortalRect, getPos, getPose, getPosWithYOffset, getRandomBodyY, getRemovalReason, getRenderDistanceMultiplier, getRidingOffset, getRootVehicle, getRotationClient, getRotationVec, getRotationVecClient, getRotationVector, getRotationVector, getSafeFallDistance, getSavedEntityId, getScoreboardTeam, getServer, getSplashSound, getStackReference, getStandingEyeHeight, getStepHeight, getSteppingBlockState, getSteppingPos, getStepSoundPos, getSwimHeight, getSwimSound, getSyncedPos, getTargetingMargin, getTeamColorValue, getTeleportTarget, getTrackedPosition, getType, getUnscaledRidingOffset, getUuid, getUuidAsString, getVehicle, getVelocity, getVelocityMultiplier, getVisibilityBoundingBox, getWidth, getWorld, getX, getY, getYaw, getYaw, getZ, handleAttack, handleFallDamage, handleStatus, hasCollidedSoftly, hasControllingPassenger, hasCustomName, hashCode, hasNoGravity, hasPassenger, hasPassenger, hasPassengerDeep, hasPassengers, hasPermissionLevel, hasPlayerRider, hasPortalCooldown, hasVehicle, interact, interactAt, isAlive, isCollidable, isConnectedThroughVehicle, isCrawling, isCustomNameVisible, isDescending, isFlappingWings, isFrozen, isGlowing, isGlowingLocal, isImmuneToExplosion, isInFluid, isInLava, isInPose, isInRange, isInRange, isInsideWall, isInsideWaterOrBubbleColumn, isInSneakingPose, isInSwimmingPose, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isLiving, isLogicalSideForUpdatingMovement, isOnFire, isOnGround, isOnRail, isPartOf, isPlayer, isPushable, isPushedByFluids, isRegionUnloaded, isRemoved, isSilent, isSneaking, isSneaky, isSpectator, isSprinting, isSubmergedIn, isSubmergedInWater, isSupportedBy, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, kill, lerpPosAndRotation, limitFallDistance, lookAt, move, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onDamaged, onDataTrackerUpdate, onKilledOther, onLanding, onPassengerLookAround, onRemoved, onSpawnPacket, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, onSwimmingStart, playCombinationStepSounds, playExtinguishSound, playSecondaryStepSound, playSound, playSoundIfNotSilent, playStepSound, playSwimSound, playSwimSound, populateCrashReport, positionInPortal, pushAwayFrom, pushOutOfBlocks, raycast, readNbt, refreshPosition, refreshPositionAfterTeleport, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, reinitDimensions, remove, removeAllPassengers, removeFromDimension, removePassenger, removeScoreboardTag, requestTeleport, requestTeleportAndDismount, requestTeleportOffset, resetPortalCooldown, resetPosition, saveNbt, saveSelfNbt, scheduleVelocityUpdate, sendMessage, setAir, setBodyYaw, setBoundingBox, setChangeListener, setCustomName, setCustomNameVisible, setFireTicks, setFlag, setFrozenTicks, setGlowing, setHeadYaw, setId, setInNetherPortal, setInPowderSnow, setInvisible, setInvulnerable, setNoGravity, setOnFire, setOnFireFor, setOnFireFromLava, setOnGround, setOnGround, setPitch, setPortalCooldown, setPos, setPose, setPosition, setPosition, setRemoved, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSprinting, setStepHeight, setSwimming, setUuid, setVelocity, setVelocity, setVelocityClient, setWorld, setYaw, shouldBroadcastConsoleToOps, shouldControlVehicles, shouldDismountUnderwater, shouldEscapePowderSnow, shouldReceiveFeedback, shouldRender, shouldRender, shouldRenderName, shouldSave, shouldSetPositionOnLoad, shouldSpawnSprintingParticles, shouldTrackOutput, slowMovement, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, startRiding, startRiding, stopRiding, streamPassengersAndSelf, streamSelfAndPassengers, teleport, teleport, tickInVoid, tickPortal, tickPortalCooldown, tickRiding, toNbtList, toNbtList, toString, tryCheckBlockCollision, unsetRemoved, updateEventHandler, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateSupportingBlockPos, updateSwimming, updateTrackedHeadRotation, updateTrackedPosition, updateTrackedPositionAndAngles, updateVelocity, updateWaterState, writeNbt
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.server.command.CommandOutput
cannotBeSilenced
-
Field Details
-
STACK
- Mappings:
Namespace Name Mixin selector official c
Lbyn;c:Laee;
intermediary field_7199
Lnet/minecraft/class_1542;field_7199:Lnet/minecraft/class_2940;
named STACK
Lnet/minecraft/entity/ItemEntity;STACK:Lnet/minecraft/entity/data/TrackedData;
-
DESPAWN_AGE
private static final int DESPAWN_AGE- See Also:
- Mappings:
Namespace Name Mixin selector official d
Lbyn;d:I
intermediary field_30456
Lnet/minecraft/class_1542;field_30456:I
named DESPAWN_AGE
Lnet/minecraft/entity/ItemEntity;DESPAWN_AGE:I
-
CANNOT_PICK_UP_DELAY
private static final int CANNOT_PICK_UP_DELAY- See Also:
- Mappings:
Namespace Name Mixin selector official e
Lbyn;e:I
intermediary field_30457
Lnet/minecraft/class_1542;field_30457:I
named CANNOT_PICK_UP_DELAY
Lnet/minecraft/entity/ItemEntity;CANNOT_PICK_UP_DELAY:I
-
NEVER_DESPAWN_AGE
private static final int NEVER_DESPAWN_AGE- See Also:
- Mappings:
Namespace Name Mixin selector official f
Lbyn;f:I
intermediary field_30458
Lnet/minecraft/class_1542;field_30458:I
named NEVER_DESPAWN_AGE
Lnet/minecraft/entity/ItemEntity;NEVER_DESPAWN_AGE:I
-
itemAge
private int itemAgeThe number of ticks since this item entity has been created. It is a short value with keyAge
in the NBT structure.It differs from
Entity.age
.- Mappings:
Namespace Name Mixin selector official g
Lbyn;g:I
intermediary field_7204
Lnet/minecraft/class_1542;field_7204:I
named itemAge
Lnet/minecraft/entity/ItemEntity;itemAge:I
-
pickupDelay
private int pickupDelay- Mappings:
Namespace Name Mixin selector official h
Lbyn;h:I
intermediary field_7202
Lnet/minecraft/class_1542;field_7202:I
named pickupDelay
Lnet/minecraft/entity/ItemEntity;pickupDelay:I
-
health
private int health- Mappings:
Namespace Name Mixin selector official i
Lbyn;i:I
intermediary field_7201
Lnet/minecraft/class_1542;field_7201:I
named health
Lnet/minecraft/entity/ItemEntity;health:I
-
thrower
- Mappings:
Namespace Name Mixin selector official j
Lbyn;j:Ljava/util/UUID;
intermediary field_7200
Lnet/minecraft/class_1542;field_7200:Ljava/util/UUID;
named thrower
Lnet/minecraft/entity/ItemEntity;thrower:Ljava/util/UUID;
-
owner
- Mappings:
Namespace Name Mixin selector official k
Lbyn;k:Ljava/util/UUID;
intermediary field_41893
Lnet/minecraft/class_1542;field_41893:Ljava/util/UUID;
named owner
Lnet/minecraft/entity/ItemEntity;owner:Ljava/util/UUID;
-
uniqueOffset
public final float uniqueOffset- Mappings:
Namespace Name Mixin selector official b
Lbyn;b:F
intermediary field_7203
Lnet/minecraft/class_1542;field_7203:F
named uniqueOffset
Lnet/minecraft/entity/ItemEntity;uniqueOffset:F
-
-
Constructor Details
-
ItemEntity
- Mappings:
Namespace Name Mixin selector official <init>
Lbiq;<init>(Lbiu;Lcpv;)V
intermediary <init>
Lnet/minecraft/class_1297;<init>(Lnet/minecraft/class_1299;Lnet/minecraft/class_1937;)V
named <init>
Lnet/minecraft/entity/Entity;<init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)V
-
ItemEntity
- Mappings:
Namespace Name Mixin selector official <init>
Lbyn;<init>(Lcpv;DDDLcjf;)V
intermediary <init>
Lnet/minecraft/class_1542;<init>(Lnet/minecraft/class_1937;DDDLnet/minecraft/class_1799;)V
named <init>
Lnet/minecraft/entity/ItemEntity;<init>(Lnet/minecraft/world/World;DDDLnet/minecraft/item/ItemStack;)V
-
ItemEntity
public ItemEntity(World world, double x, double y, double z, ItemStack stack, double velocityX, double velocityY, double velocityZ) - Mappings:
Namespace Name Mixin selector official <init>
Lbyn;<init>(Lcpv;DDDLcjf;DDD)V
intermediary <init>
Lnet/minecraft/class_1542;<init>(Lnet/minecraft/class_1937;DDDLnet/minecraft/class_1799;DDD)V
named <init>
Lnet/minecraft/entity/ItemEntity;<init>(Lnet/minecraft/world/World;DDDLnet/minecraft/item/ItemStack;DDD)V
-
ItemEntity
- Mappings:
Namespace Name Mixin selector official <init>
Lbyn;<init>(Lbyn;)V
intermediary <init>
Lnet/minecraft/class_1542;<init>(Lnet/minecraft/class_1542;)V
named <init>
Lnet/minecraft/entity/ItemEntity;<init>(Lnet/minecraft/entity/ItemEntity;)V
-
-
Method Details
-
occludeVibrationSignals
public boolean occludeVibrationSignals()Returns whether the entity should not emit vibrations.By default, wool or carpet item entities, and
WardenEntity
do not emit vibrations.- Overrides:
occludeVibrationSignals
in classEntity
- Returns:
- whether the entity should not emit vibrations
- Mappings:
Namespace Name Mixin selector official aV
Lbiq;aV()Z
intermediary method_33189
Lnet/minecraft/class_1297;method_33189()Z
named occludeVibrationSignals
Lnet/minecraft/entity/Entity;occludeVibrationSignals()Z
-
getOwner
-
getMoveEffect
Returns the possible effect(s) of an entity moving.- Overrides:
getMoveEffect
in classEntity
- Mappings:
Namespace Name Mixin selector official aU
Lbiq;aU()Lbiq$b;
intermediary method_33570
Lnet/minecraft/class_1297;method_33570()Lnet/minecraft/class_1297$class_5799;
named getMoveEffect
Lnet/minecraft/entity/Entity;getMoveEffect()Lnet/minecraft/entity/Entity$MoveEffect;
-
initDataTracker
protected void initDataTracker()Initializes data tracker.- Specified by:
initDataTracker
in classEntity
- Mappings:
Namespace Name Mixin selector official a_
Lbiq;a_()V
intermediary method_5693
Lnet/minecraft/class_1297;method_5693()V
named initDataTracker
Lnet/minecraft/entity/Entity;initDataTracker()V
-
tick
public void tick()Ticks this entity. -
getVelocityAffectingPos
- Overrides:
getVelocityAffectingPos
in classEntity
- Mappings:
Namespace Name Mixin selector official aG
Lbiq;aG()Lgw;
intermediary method_23314
Lnet/minecraft/class_1297;method_23314()Lnet/minecraft/class_2338;
named getVelocityAffectingPos
Lnet/minecraft/entity/Entity;getVelocityAffectingPos()Lnet/minecraft/util/math/BlockPos;
-
applyWaterBuoyancy
private void applyWaterBuoyancy()- Mappings:
Namespace Name Mixin selector official E
Lbyn;E()V
intermediary method_6974
Lnet/minecraft/class_1542;method_6974()V
named applyWaterBuoyancy
Lnet/minecraft/entity/ItemEntity;applyWaterBuoyancy()V
-
applyLavaBuoyancy
private void applyLavaBuoyancy()- Mappings:
Namespace Name Mixin selector official F
Lbyn;F()V
intermediary method_24348
Lnet/minecraft/class_1542;method_24348()V
named applyLavaBuoyancy
Lnet/minecraft/entity/ItemEntity;applyLavaBuoyancy()V
-
tryMerge
private void tryMerge()- Mappings:
Namespace Name Mixin selector official G
Lbyn;G()V
intermediary method_6973
Lnet/minecraft/class_1542;method_6973()V
named tryMerge
Lnet/minecraft/entity/ItemEntity;tryMerge()V
-
canMerge
private boolean canMerge()- Mappings:
Namespace Name Mixin selector official H
Lbyn;H()Z
intermediary method_20397
Lnet/minecraft/class_1542;method_20397()Z
named canMerge
Lnet/minecraft/entity/ItemEntity;canMerge()Z
-
tryMerge
- Mappings:
Namespace Name Mixin selector official a
Lbyn;a(Lbyn;)V
intermediary method_6972
Lnet/minecraft/class_1542;method_6972(Lnet/minecraft/class_1542;)V
named tryMerge
Lnet/minecraft/entity/ItemEntity;tryMerge(Lnet/minecraft/entity/ItemEntity;)V
-
canMerge
- Mappings:
Namespace Name Mixin selector official a
Lbyn;a(Lcjf;Lcjf;)Z
intermediary method_24017
Lnet/minecraft/class_1542;method_24017(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Z
named canMerge
Lnet/minecraft/entity/ItemEntity;canMerge(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z
-
merge
- Mappings:
Namespace Name Mixin selector official a
Lbyn;a(Lcjf;Lcjf;I)Lcjf;
intermediary method_24018
Lnet/minecraft/class_1542;method_24018(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;I)Lnet/minecraft/class_1799;
named merge
Lnet/minecraft/entity/ItemEntity;merge(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;I)Lnet/minecraft/item/ItemStack;
-
merge
- Mappings:
Namespace Name Mixin selector official a
Lbyn;a(Lbyn;Lcjf;Lcjf;)V
intermediary method_24016
Lnet/minecraft/class_1542;method_24016(Lnet/minecraft/class_1542;Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)V
named merge
Lnet/minecraft/entity/ItemEntity;merge(Lnet/minecraft/entity/ItemEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)V
-
merge
private static void merge(ItemEntity targetEntity, ItemStack targetStack, ItemEntity sourceEntity, ItemStack sourceStack) - Mappings:
Namespace Name Mixin selector official a
Lbyn;a(Lbyn;Lcjf;Lbyn;Lcjf;)V
intermediary method_18006
Lnet/minecraft/class_1542;method_18006(Lnet/minecraft/class_1542;Lnet/minecraft/class_1799;Lnet/minecraft/class_1542;Lnet/minecraft/class_1799;)V
named merge
Lnet/minecraft/entity/ItemEntity;merge(Lnet/minecraft/entity/ItemEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/ItemEntity;Lnet/minecraft/item/ItemStack;)V
-
isFireImmune
public boolean isFireImmune()Returns whether the entity is immune to fire damage.- Overrides:
isFireImmune
in classEntity
- Returns:
- whether the entity is immune to fire damage
- See Also:
- Mappings:
Namespace Name Mixin selector official aW
Lbiq;aW()Z
intermediary method_5753
Lnet/minecraft/class_1297;method_5753()Z
named isFireImmune
Lnet/minecraft/entity/Entity;isFireImmune()Z
-
damage
Applies a damage to this entity. The exact implementation differs between subclasses.LivingEntity
has health value, and damaging the entity decreases it. This also handles shields, extra damage to helmets for falling blocks, setting the attacker, playing hurt sound, etc.Some entities like
ItemEntity
also have health value, which the overridden method decrements. There also exist several entities, likeEndCrystalEntity
, where any damage discards the entity (perhaps with an explosion).If this is overridden, it must check the result of
Entity.isInvulnerableTo(net.minecraft.entity.damage.DamageSource)
and return early.- Overrides:
damage
in classEntity
- Returns:
- whether the entity was actually damaged
- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lbiq;a(Lbho;F)Z
intermediary method_5643
Lnet/minecraft/class_1297;method_5643(Lnet/minecraft/class_1282;F)Z
named damage
Lnet/minecraft/entity/Entity;damage(Lnet/minecraft/entity/damage/DamageSource;F)Z
-
writeCustomDataToNbt
Writes custom data tonbt
. Subclasses have to implement this.NBT is a storage format; therefore, a data from NBT is loaded to an entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the entity.
- Specified by:
writeCustomDataToNbt
in classEntity
- See Also:
- Mappings:
Namespace Name Mixin selector official b
Lbiq;b(Lqw;)V
intermediary method_5652
Lnet/minecraft/class_1297;method_5652(Lnet/minecraft/class_2487;)V
named writeCustomDataToNbt
Lnet/minecraft/entity/Entity;writeCustomDataToNbt(Lnet/minecraft/nbt/NbtCompound;)V
-
readCustomDataFromNbt
Reads custom data fromnbt
. Subclasses have to implement this.NBT is a storage format; therefore, a data from NBT is loaded to an entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the entity.
nbt
might not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.- Specified by:
readCustomDataFromNbt
in classEntity
- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lbiq;a(Lqw;)V
intermediary method_5749
Lnet/minecraft/class_1297;method_5749(Lnet/minecraft/class_2487;)V
named readCustomDataFromNbt
Lnet/minecraft/entity/Entity;readCustomDataFromNbt(Lnet/minecraft/nbt/NbtCompound;)V
-
onPlayerCollision
Called when a player collides with the entity. Does nothing by default.This should be overridden if the collision logic is specific to players, such as picking up item entities, experience orbs, or arrows.
- Overrides:
onPlayerCollision
in classEntity
- Mappings:
Namespace Name Mixin selector official b_
Lbiq;b_(Lcbu;)V
intermediary method_5694
Lnet/minecraft/class_1297;method_5694(Lnet/minecraft/class_1657;)V
named onPlayerCollision
Lnet/minecraft/entity/Entity;onPlayerCollision(Lnet/minecraft/entity/player/PlayerEntity;)V
-
getName
Returns the name of this object.This should return the custom name if it exists, otherwise the default name. This should not have styling applied.
- Specified by:
getName
in interfaceNameable
- Overrides:
getName
in classEntity
- Returns:
- the name of this object
- Mappings:
Namespace Name Mixin selector official ab
Lbhc;ab()Ltl;
intermediary method_5477
Lnet/minecraft/class_1275;method_5477()Lnet/minecraft/class_2561;
named getName
Lnet/minecraft/util/Nameable;getName()Lnet/minecraft/text/Text;
-
isAttackable
public boolean isAttackable()Returns whether the entity can be attacked by players.Note that this is not called for most entities defined in vanilla as unattackable (such as
ItemEntity
andExperienceOrbEntity
) as trying to attack them kicks the player.- Overrides:
isAttackable
in classEntity
- Returns:
- whether the entity can be attacked by players
- See Also:
- Mappings:
Namespace Name Mixin selector official cp
Lbiq;cp()Z
intermediary method_5732
Lnet/minecraft/class_1297;method_5732()Z
named isAttackable
Lnet/minecraft/entity/Entity;isAttackable()Z
-
moveToWorld
Moves this entity to another world.Note all entities except server player entities are completely recreated at the destination.
- Overrides:
moveToWorld
in classEntity
- Returns:
- the entity in the other world
- Mappings:
Namespace Name Mixin selector official b
Lbiq;b(Lakq;)Lbiq;
intermediary method_5731
Lnet/minecraft/class_1297;method_5731(Lnet/minecraft/class_3218;)Lnet/minecraft/class_1297;
named moveToWorld
Lnet/minecraft/entity/Entity;moveToWorld(Lnet/minecraft/server/world/ServerWorld;)Lnet/minecraft/entity/Entity;
-
getStack
Returns the item stack contained in this item entity.- Mappings:
Namespace Name Mixin selector official q
Lbyn;q()Lcjf;
intermediary method_6983
Lnet/minecraft/class_1542;method_6983()Lnet/minecraft/class_1799;
named getStack
Lnet/minecraft/entity/ItemEntity;getStack()Lnet/minecraft/item/ItemStack;
-
setStack
Sets the item stack contained in this item entity tostack
.- Mappings:
Namespace Name Mixin selector official a
Lbyn;a(Lcjf;)V
intermediary method_6979
Lnet/minecraft/class_1542;method_6979(Lnet/minecraft/class_1799;)V
named setStack
Lnet/minecraft/entity/ItemEntity;setStack(Lnet/minecraft/item/ItemStack;)V
-
onTrackedDataSet
Called on the client when the tracked data is set.This can be overridden to refresh other fields when the tracked data is set or changed.
- Overrides:
onTrackedDataSet
in classEntity
- Mappings:
Namespace Name Mixin selector official a
Lbiq;a(Laee;)V
intermediary method_5674
Lnet/minecraft/class_1297;method_5674(Lnet/minecraft/class_2940;)V
named onTrackedDataSet
Lnet/minecraft/entity/Entity;onTrackedDataSet(Lnet/minecraft/entity/data/TrackedData;)V
-
setOwner
- Mappings:
Namespace Name Mixin selector official b
Lbyn;b(Ljava/util/UUID;)V
intermediary method_48349
Lnet/minecraft/class_1542;method_48349(Ljava/util/UUID;)V
named setOwner
Lnet/minecraft/entity/ItemEntity;setOwner(Ljava/util/UUID;)V
-
setThrower
Sets the thrower of this item entity tothrower
.- Mappings:
Namespace Name Mixin selector official c
Lbyn;c(Ljava/util/UUID;)V
intermediary method_6981
Lnet/minecraft/class_1542;method_6981(Ljava/util/UUID;)V
named setThrower
Lnet/minecraft/entity/ItemEntity;setThrower(Ljava/util/UUID;)V
-
getItemAge
public int getItemAge()Returns the number of ticks since this item entity has been created.Increases every tick. When it equals to 6000 ticks (5 minutes), this item entity disappears.
Unlike Entity.age, it is persistent and not synchronized between the client and the server.
- See Also:
- Mappings:
Namespace Name Mixin selector official s
Lbyn;s()I
intermediary method_6985
Lnet/minecraft/class_1542;method_6985()I
named getItemAge
Lnet/minecraft/entity/ItemEntity;getItemAge()I
-
setToDefaultPickupDelay
public void setToDefaultPickupDelay()Sets the number of ticks before this item entity can be picked up to the default value of 10.- Mappings:
Namespace Name Mixin selector official t
Lbyn;t()V
intermediary method_6988
Lnet/minecraft/class_1542;method_6988()V
named setToDefaultPickupDelay
Lnet/minecraft/entity/ItemEntity;setToDefaultPickupDelay()V
-
resetPickupDelay
public void resetPickupDelay()Sets the number of ticks before this item entity can be picked up to 0.- Mappings:
Namespace Name Mixin selector official w
Lbyn;w()V
intermediary method_6975
Lnet/minecraft/class_1542;method_6975()V
named resetPickupDelay
Lnet/minecraft/entity/ItemEntity;resetPickupDelay()V
-
setPickupDelayInfinite
public void setPickupDelayInfinite()Makes this item entity impossible to be picked up by setting its pickup delay to 32767.- Mappings:
Namespace Name Mixin selector official x
Lbyn;x()V
intermediary method_6989
Lnet/minecraft/class_1542;method_6989()V
named setPickupDelayInfinite
Lnet/minecraft/entity/ItemEntity;setPickupDelayInfinite()V
-
setPickupDelay
public void setPickupDelay(int pickupDelay) Sets the number of ticks before this item entity can be picked up topickupDelay
.- Mappings:
Namespace Name Mixin selector official b
Lbyn;b(I)V
intermediary method_6982
Lnet/minecraft/class_1542;method_6982(I)V
named setPickupDelay
Lnet/minecraft/entity/ItemEntity;setPickupDelay(I)V
-
cannotPickup
public boolean cannotPickup()Returns whether the pickup delay of this item entity is greater than 0.- Mappings:
Namespace Name Mixin selector official y
Lbyn;y()Z
intermediary method_6977
Lnet/minecraft/class_1542;method_6977()Z
named cannotPickup
Lnet/minecraft/entity/ItemEntity;cannotPickup()Z
-
setNeverDespawn
public void setNeverDespawn()- Mappings:
Namespace Name Mixin selector official z
Lbyn;z()V
intermediary method_35190
Lnet/minecraft/class_1542;method_35190()V
named setNeverDespawn
Lnet/minecraft/entity/ItemEntity;setNeverDespawn()V
-
setCovetedItem
public void setCovetedItem()- Mappings:
Namespace Name Mixin selector official A
Lbyn;A()V
intermediary method_6976
Lnet/minecraft/class_1542;method_6976()V
named setCovetedItem
Lnet/minecraft/entity/ItemEntity;setCovetedItem()V
-
setDespawnImmediately
public void setDespawnImmediately()- Mappings:
Namespace Name Mixin selector official B
Lbyn;B()V
intermediary method_6987
Lnet/minecraft/class_1542;method_6987()V
named setDespawnImmediately
Lnet/minecraft/entity/ItemEntity;setDespawnImmediately()V
-
getRotation
public float getRotation(float tickDelta) - Mappings:
Namespace Name Mixin selector official a
Lbyn;a(F)F
intermediary method_27314
Lnet/minecraft/class_1542;method_27314(F)F
named getRotation
Lnet/minecraft/entity/ItemEntity;getRotation(F)F
-
copy
- Mappings:
Namespace Name Mixin selector official C
Lbyn;C()Lbyn;
intermediary method_29271
Lnet/minecraft/class_1542;method_29271()Lnet/minecraft/class_1542;
named copy
Lnet/minecraft/entity/ItemEntity;copy()Lnet/minecraft/entity/ItemEntity;
-
getSoundCategory
Returns the sound category for sounds from this entity.This is used by
Entity.playSound(SoundEvent, float, float)
and defaults toSoundCategory.NEUTRAL
. Hostile entities should override this to returnSoundCategory.HOSTILE
.- Overrides:
getSoundCategory
in classEntity
- Returns:
- the sound category for sounds from this entity
- See Also:
- Mappings:
Namespace Name Mixin selector official da
Lbiq;da()Lape;
intermediary method_5634
Lnet/minecraft/class_1297;method_5634()Lnet/minecraft/class_3419;
named getSoundCategory
Lnet/minecraft/entity/Entity;getSoundCategory()Lnet/minecraft/sound/SoundCategory;
-
getBodyYaw
public float getBodyYaw()Returns the body yaw of the entity.- Overrides:
getBodyYaw
in classEntity
- Returns:
- the body yaw of the entity
- See Also:
- Mappings:
Namespace Name Mixin selector official dC
Lbiq;dC()F
intermediary method_43078
Lnet/minecraft/class_1297;method_43078()F
named getBodyYaw
Lnet/minecraft/entity/Entity;getBodyYaw()F
-