Package net.minecraft.entity
Class ItemEntity
java.lang.Object
net.minecraft.entity.Entity
net.minecraft.entity.ItemEntity
- All Implemented Interfaces:
CommandOutput
,Nameable
public class ItemEntity extends Entity
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.PositionUpdater
-
Field Summary
Fields Modifier and Type Field Description private int
age
private int
health
float
hoverHeight
private UUID
owner
private int
pickupDelay
private static TrackedData<ItemStack>
STACK
private UUID
thrower
Fields inherited from class net.minecraft.entity.Entity
chunkX, chunkY, chunkZ, dataTracker, distanceTraveled, fallDistance, field_25599, firstUpdate, FLAGS, fluidHeight, glowing, horizontalCollision, horizontalSpeed, ignoreCameraFrustum, inanimate, inNetherPortal, lastNetherPortalPosition, lastRenderX, lastRenderY, lastRenderZ, LOGGER, movementMultiplier, netherPortalTime, noClip, onGround, pitch, POSE, prevHorizontalSpeed, prevPitch, prevX, prevY, prevYaw, prevZ, pushSpeedReduction, random, removed, ridingCooldown, stepHeight, submergedInWater, teleporting, timeUntilRegen, touchingWater, updateNeeded, uuid, uuidString, velocityDirty, velocityModified, verticalCollision, world, yaw
Fields inherited from interface net.minecraft.server.command.CommandOutput
DUMMY
-
Constructor Summary
Constructors Modifier Constructor Description ItemEntity(EntityType<? extends ItemEntity> type, World world)
private
ItemEntity(ItemEntity itemEntity)
ItemEntity(World world, double x, double y, double z)
ItemEntity(World world, double x, double y, double z, ItemStack stack)
-
Method Summary
Modifier and Type Method Description private void
applyBuoyancy()
protected boolean
canClimb()
private boolean
canMerge()
static boolean
canMerge(ItemStack stack1, ItemStack stack2)
boolean
cannotPickup()
Packet<?>
createSpawnPacket()
boolean
damage(DamageSource source, float amount)
int
getAge()
Text
getName()
UUID
getOwner()
ItemStack
getStack()
UUID
getThrower()
protected void
initDataTracker()
boolean
isAttackable()
boolean
isFireImmune()
private static void
merge(ItemEntity targetEntity, ItemStack targetStack, ItemEntity sourceEntity, ItemStack sourceStack)
private static void
merge(ItemEntity targetEntity, ItemStack stack1, ItemStack stack2)
static ItemStack
merge(ItemStack stack1, ItemStack stack2, int maxCount)
private void
method_24348()
float
method_27314(float float2)
ItemEntity
method_29271()
Entity
moveToWorld(ServerWorld destination)
Moves this entity to another world.void
onPlayerCollision(PlayerEntity player)
void
onTrackedDataSet(TrackedData<?> data)
void
readCustomDataFromTag(CompoundTag tag)
void
resetPickupDelay()
void
setCovetedItem()
void
setDespawnImmediately()
void
setOwner(UUID uuid)
void
setPickupDelay(int pickupDelay)
void
setPickupDelayInfinite()
void
setStack(ItemStack stack)
void
setThrower(UUID uuid)
void
setToDefaultPickupDelay()
void
tick()
private void
tryMerge()
private void
tryMerge(ItemEntity other)
void
writeCustomDataToTag(CompoundTag tag)
Methods inherited from class net.minecraft.entity.Entity
addPassenger, addScoreboardTag, addVelocity, adjustMovementForCollisions, adjustMovementForCollisions, adjustMovementForPiston, adjustMovementForSneaking, adjustSingleAxisMovementForCollisions, afterSpawn, animateDamage, applyMirror, applyRotation, baseTick, bypassesLandingEffects, bypassesSteppingEffects, calculateBoundsForPose, calculateDimensions, calculateNextStepSoundDistance, canAddPassenger, canAvoidTraps, canBeRiddenInWater, canBeSpectated, canExplosionDestroyBlock, canFly, canStartRiding, canUsePortals, changeLookDirection, checkBlockCollision, checkDespawn, checkWaterState, collides, collidesWith, copyFrom, copyPositionAndRotation, dealDamage, destroy, detach, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, entityDataRequiresOperator, equals, equip, equipStack, extinguish, fall, fromTag, getAir, getArmorItems, getBlockPos, getBodyY, getBoundingBox, getBrightnessAtEyes, getBurningDuration, getCameraPosVec, getCommandSource, getCustomName, getDataTracker, getDefaultName, getDefaultNetherPortalCooldown, getDimensions, getDisplayName, getEffectiveExplosionResistance, getEntityId, getEntityName, getEntityWorld, getEyeHeight, getEyeHeight, getEyeY, getFireTicks, getFlag, getFluidHeight, getHeadYaw, getHeight, getHeightOffset, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getItemsEquipped, getItemsHand, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getMaxAir, getMaxNetherPortalTime, getMountedHeightOffset, getMovementDirection, getOppositeRotationVector, getOppositeRotationVector, getParticleX, getParticleZ, getPassengerDismountOffset, getPassengerList, getPassengersDeep, getPermissionLevel, getPistonBehavior, getPitch, getPos, getPose, getPrimaryPassenger, getRandomBodyY, getRenderDistanceMultiplier, getRootVehicle, getRotationClient, getRotationVec, getRotationVecClient, getRotationVector, getRotationVector, getSafeFallDistance, getSavedEntityId, getScoreboardTags, getScoreboardTeam, getServer, getSoundCategory, getSplashSound, getStandingEyeHeight, getSwimSound, getTargetingMargin, getTeamColorValue, getTeleportTarget, getTrackedPosition, getType, getUuid, getUuidAsString, getVehicle, getVelocity, getVelocityAffectingPos, getVelocityMultiplier, getVisibilityBoundingBox, getWidth, getX, getY, getYaw, getZ, handleAttack, handleFallDamage, handleStatus, hasCustomName, hashCode, hasNetherPortalCooldown, hasNoGravity, hasPassenger, hasPassengerDeep, hasPassengers, hasPassengerType, hasPermissionLevel, hasPlayerRider, hasVehicle, hasWings, interact, interactAt, isAlive, isChunkPosUpdateRequested, isCollidable, isConnectedThroughVehicle, isCustomNameVisible, isDescending, isGlowing, isImmuneToExplosion, isInLava, isInRange, isInsideWall, isInsideWaterOrBubbleColumn, isInSneakingPose, isInSwimmingPose, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isLiving, isLogicalSideForUpdatingMovement, isOnFire, isOnGround, isPartOf, isPushable, isSilent, isSneaking, isSneaky, isSpectator, isSprinting, isSubmergedIn, isSubmergedInWater, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, kill, lookAt, method_29239, method_29241, method_29919, method_30076, method_30330, method_30632, method_30633, method_30634, method_30950, method_30951, method_31166, move, moveToBoundingBoxCenter, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onKilledOther, onPassengerLookAround, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, onSwimmingStart, playFlySound, playSound, playStepSound, playSwimSound, populateCrashReport, pushAwayFrom, pushOutOfBlocks, raycast, refreshPosition, refreshPositionAfterTeleport, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, remove, removeAllPassengers, removePassenger, removeScoreboardTag, requestTeleport, resetNetherPortalCooldown, resetPosition, saveSelfToTag, saveToTag, scheduleVelocityUpdate, sendSystemMessage, setAir, setBoundingBox, setCustomName, setCustomNameVisible, setEntityId, setFireTicks, setFlag, setGlowing, setHeadYaw, setInNetherPortal, setInvisible, setInvulnerable, setNoGravity, setOnFireFor, setOnFireFromLava, setOnGround, setPos, setPose, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSprinting, setSwimming, setUuid, setVelocity, setVelocity, setVelocityClient, setWorld, setYaw, shouldBroadcastConsoleToOps, shouldLeaveSwimmingPose, shouldReceiveFeedback, shouldRender, shouldRender, shouldRenderName, shouldSetPositionOnLoad, shouldSpawnSprintingParticles, shouldTrackOutput, slowMovement, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, squaredHorizontalLength, startRiding, startRiding, stopRiding, streamPassengersRecursively, teleport, teleportRequested, tickNetherPortal, tickNetherPortalCooldown, tickRiding, toListTag, toListTag, toString, toTag, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateSwimming, updateTrackedHeadRotation, updateTrackedPosition, updateTrackedPosition, updateTrackedPositionAndAngles, updateVelocity, updateWaterState, wouldPoseNotCollide
-
Field Details
-
STACK
-
age
private int age -
pickupDelay
private int pickupDelay -
health
private int health -
thrower
-
owner
-
hoverHeight
public final float hoverHeight
-
-
Constructor Details
-
ItemEntity
-
ItemEntity
-
ItemEntity
-
ItemEntity
-
-
Method Details
-
canClimb
protected boolean canClimb() -
initDataTracker
protected void initDataTracker()- Specified by:
initDataTracker
in classEntity
-
tick
public void tick() -
applyBuoyancy
private void applyBuoyancy() -
method_24348
private void method_24348() -
tryMerge
private void tryMerge() -
canMerge
private boolean canMerge() -
tryMerge
-
canMerge
-
merge
-
merge
-
merge
private static void merge(ItemEntity targetEntity, ItemStack targetStack, ItemEntity sourceEntity, ItemStack sourceStack) -
isFireImmune
public boolean isFireImmune()- Overrides:
isFireImmune
in classEntity
-
damage
-
writeCustomDataToTag
- Specified by:
writeCustomDataToTag
in classEntity
-
readCustomDataFromTag
- Specified by:
readCustomDataFromTag
in classEntity
-
onPlayerCollision
- Overrides:
onPlayerCollision
in classEntity
-
getName
-
isAttackable
public boolean isAttackable()- Overrides:
isAttackable
in classEntity
-
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
-
getStack
-
setStack
-
onTrackedDataSet
- Overrides:
onTrackedDataSet
in classEntity
-
getOwner
-
setOwner
-
getThrower
-
setThrower
-
getAge
@Environment(CLIENT) public int getAge() -
setToDefaultPickupDelay
public void setToDefaultPickupDelay() -
resetPickupDelay
public void resetPickupDelay() -
setPickupDelayInfinite
public void setPickupDelayInfinite() -
setPickupDelay
public void setPickupDelay(int pickupDelay) -
cannotPickup
public boolean cannotPickup() -
setCovetedItem
public void setCovetedItem() -
setDespawnImmediately
public void setDespawnImmediately() -
method_27314
@Environment(CLIENT) public float method_27314(float float2) -
createSpawnPacket
- Specified by:
createSpawnPacket
in classEntity
-
method_29271
-