Package net.minecraft.entity.item
Class ItemEntity
- java.lang.Object
-
- net.minecraftforge.common.capabilities.CapabilityProvider<Entity>
-
- net.minecraft.entity.Entity
-
- net.minecraft.entity.item.ItemEntity
-
- All Implemented Interfaces:
ICommandSource
,INameable
,ICapabilityProvider
,ICapabilitySerializable<CompoundNBT>
,IForgeEntity
,INBTSerializable<CompoundNBT>
public class ItemEntity extends Entity
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.IMoveCallback
-
-
Field Summary
Fields Modifier and Type Field Description private int
age
float
bobOffs
private static DataParameter<ItemStack>
DATA_ITEM
private int
health
int
lifespan
The maximum age of this EntityItem.private java.util.UUID
owner
private int
pickupDelay
private java.util.UUID
thrower
-
Fields inherited from class net.minecraft.entity.Entity
blocksBuilding, boardingCooldown, DATA_POSE, DATA_SHARED_FLAGS_ID, ENTITY_COUNTER, entityData, fallDistance, firstTick, fluidHeight, fluidOnEyes, forcedLoading, glowing, hasImpulse, horizontalCollision, hurtMarked, inChunk, invulnerableTime, isInsidePortal, level, LOGGER, maxUpStep, moveDist, noCulling, noPhysics, onGround, portalEntrancePos, portalTime, pushthrough, random, removed, stringUUID, stuckSpeedMultiplier, tickCount, uuid, verticalCollision, walkDist, walkDistO, wasEyeInWater, wasTouchingWater, xChunk, xo, xOld, xRot, xRotO, yChunk, yo, yOld, yRot, yRotO, zChunk, zo, zOld
-
Fields inherited from interface net.minecraft.command.ICommandSource
NULL
-
-
Constructor Summary
Constructors Modifier Constructor Description ItemEntity(EntityType<? extends ItemEntity> p_i50217_1_, World p_i50217_2_)
private
ItemEntity(ItemEntity p_i231561_1_)
ItemEntity(World p_i1709_1_, double p_i1709_2_, double p_i1709_4_, double p_i1709_6_)
ItemEntity(World p_i1710_1_, double p_i1710_2_, double p_i1710_4_, double p_i1710_6_, ItemStack p_i1710_8_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAdditionalSaveData(CompoundNBT p_213281_1_)
static boolean
areMergable(ItemStack p_226532_0_, ItemStack p_226532_1_)
Entity
changeDimension(ServerWorld p_241206_1_, ITeleporter teleporter)
ItemEntity
copy()
protected void
defineSynchedData()
boolean
fireImmune()
IPacket<?>
getAddEntityPacket()
int
getAge()
ItemStack
getItem()
ITextComponent
getName()
java.util.UUID
getOwner()
float
getSpin(float p_234272_1_)
java.util.UUID
getThrower()
boolean
hasPickUpDelay()
boolean
hurt(DamageSource p_70097_1_, float p_70097_2_)
boolean
isAttackable()
private boolean
isMergable()
protected boolean
isMovementNoisy()
void
makeFakeItem()
private static void
merge(ItemEntity p_213858_0_, ItemStack p_213858_1_, ItemEntity p_213858_2_, ItemStack p_213858_3_)
private static void
merge(ItemEntity p_226531_0_, ItemStack p_226531_1_, ItemStack p_226531_2_)
static ItemStack
merge(ItemStack p_226533_0_, ItemStack p_226533_1_, int p_226533_2_)
private void
mergeWithNeighbours()
void
onSyncedDataUpdated(DataParameter<?> p_184206_1_)
void
playerTouch(PlayerEntity p_70100_1_)
void
readAdditionalSaveData(CompoundNBT p_70037_1_)
void
setDefaultPickUpDelay()
void
setExtendedLifetime()
void
setItem(ItemStack p_92058_1_)
void
setNeverPickUp()
void
setNoPickUpDelay()
void
setOwner(java.util.UUID p_200217_1_)
void
setPickUpDelay(int p_174867_1_)
void
setThrower(java.util.UUID p_200216_1_)
private void
setUnderLavaMovement()
private void
setUnderwaterMovement()
void
tick()
private void
tryToMerge(ItemEntity p_226530_1_)
-
Methods inherited from class net.minecraft.entity.Entity
absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addPassenger, addTag, animateHurt, awardKillScore, baseTick, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canChangeDimensions, canCollideWith, canEnterPose, canRide, canSpawnSprintParticle, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, causeFallDamage, changeDimension, checkAndResetForcedChunkAdditionFlag, checkAndResetUpdateChunkPos, checkDespawn, checkFallDamage, checkInsideBlocks, clearFire, closerThan, collideBoundingBox, collideBoundingBoxHeuristically, collideBoundingBoxLegacy, copyPosition, createCommandSourceStack, createHoverEvent, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, fillCrashReportCategory, findDimensionEntryPoint, getAirSupply, getAllSlots, getArmorSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockSpeedFactor, getBlockStateOn, getBoundingBox, getBoundingBoxForCulling, getBoundingBoxForPose, getBrightness, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControllingPassenger, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDimensions, getDirection, getDismountLocationForPassenger, getDisplayName, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyePosition, getEyeY, getFireImmuneTicks, getFluidHeight, getFluidJumpThreshold, getForward, getHandSlots, getHorizontalDistanceSqr, getId, getIndirectPassengers, getLeashOffset, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxFallDistance, getMotionDirection, getMyRidingOffset, getOnPos, getPacketCoordinates, getPassengers, getPassengersRidingOffset, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalWaitTime, getPose, getPosition, getRandomX, getRandomY, getRandomZ, getRelativePortalPosition, getRemainingFireTicks, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getType, getTypeName, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getViewXRot, getViewYRot, getX, getX, getY, getY, getYHeadRot, getZ, getZ, handleEntityEvent, handleInsidePortal, handleNetherPortal, hasCustomName, hashCode, hasIndirectPassenger, hasOnePlayerPassenger, hasPassenger, hasPassenger, hasPermissions, ignoreExplosion, interact, interactAt, is, isAddedToWorld, isAlive, isAlliedTo, isAlliedTo, isColliding, isControlledByLocalInstance, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFree, isGlowing, isIgnoringBlockTriggers, isInLava, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWall, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnGround, isOnPortalCooldown, isPassenger, isPassengerOfSameVehicle, isPickable, isPushable, isPushedByFluid, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, isVisuallySwimming, kill, killed, lavaHurt, lerpHeadTo, lerpMotion, lerpTo, limitPistonMovement, load, lookAt, makeFlySound, makeStuckInBlock, markHurt, maybeBackOffFromEdge, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, outOfWorld, pick, playFlySound, playSound, playStepSound, playSwimSound, position, positionRider, processPortalCooldown, push, push, reapplyPosition, refreshDimensions, remove, remove, removeAfterChangingDimensions, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetPos, restoreFrom, revive, rideableUnderWater, rideTick, rotate, save, saveAsPassenger, saveWithoutId, sendMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setGlowing, setId, setInvisible, setInvulnerable, setItemSlot, setLevel, setLocationFromBoundingbox, setNoGravity, setOnGround, setPacketCoordinates, setPacketCoordinates, setPortalCooldown, setPos, setPosAndOldPos, setPose, setPosRaw, setRemainingFireTicks, setRot, setSecondsOnFire, setSharedFlag, setShiftKeyDown, setSilent, setSlot, setSprinting, setSwimming, setUUID, setViewScale, setYBodyRot, setYHeadRot, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, shouldShowName, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopRiding, stopSeenByPlayer, teleportTo, teleportToWithTicket, thunderHit, toString, turn, unRide, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming
-
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
-
Methods inherited from interface net.minecraftforge.common.extensions.IForgeEntity
canBeRiddenInWater, canRiderInteract, deserializeNBT, getClassification, getDimensionsForge, getEntity, getEyeHeightForge, getParts, getPickedResult, isMultipartEntity, serializeNBT, shouldRiderSit
-
-
-
-
Field Detail
-
DATA_ITEM
private static final DataParameter<ItemStack> DATA_ITEM
-
age
private int age
-
pickupDelay
private int pickupDelay
-
health
private int health
-
thrower
private java.util.UUID thrower
-
owner
private java.util.UUID owner
-
bobOffs
public final float bobOffs
-
lifespan
public int lifespan
The maximum age of this EntityItem. The item is expired once this is reached.
-
-
Constructor Detail
-
ItemEntity
public ItemEntity(EntityType<? extends ItemEntity> p_i50217_1_, World p_i50217_2_)
-
ItemEntity
public ItemEntity(World p_i1709_1_, double p_i1709_2_, double p_i1709_4_, double p_i1709_6_)
-
ItemEntity
public ItemEntity(World p_i1710_1_, double p_i1710_2_, double p_i1710_4_, double p_i1710_6_, ItemStack p_i1710_8_)
-
ItemEntity
private ItemEntity(ItemEntity p_i231561_1_)
-
-
Method Detail
-
isMovementNoisy
protected boolean isMovementNoisy()
- Overrides:
isMovementNoisy
in classEntity
-
defineSynchedData
protected void defineSynchedData()
- Specified by:
defineSynchedData
in classEntity
-
setUnderwaterMovement
private void setUnderwaterMovement()
-
setUnderLavaMovement
private void setUnderLavaMovement()
-
mergeWithNeighbours
private void mergeWithNeighbours()
-
isMergable
private boolean isMergable()
-
tryToMerge
private void tryToMerge(ItemEntity p_226530_1_)
-
merge
private static void merge(ItemEntity p_226531_0_, ItemStack p_226531_1_, ItemStack p_226531_2_)
-
merge
private static void merge(ItemEntity p_213858_0_, ItemStack p_213858_1_, ItemEntity p_213858_2_, ItemStack p_213858_3_)
-
fireImmune
public boolean fireImmune()
- Overrides:
fireImmune
in classEntity
-
hurt
public boolean hurt(DamageSource p_70097_1_, float p_70097_2_)
-
addAdditionalSaveData
public void addAdditionalSaveData(CompoundNBT p_213281_1_)
- Specified by:
addAdditionalSaveData
in classEntity
-
readAdditionalSaveData
public void readAdditionalSaveData(CompoundNBT p_70037_1_)
- Specified by:
readAdditionalSaveData
in classEntity
-
playerTouch
public void playerTouch(PlayerEntity p_70100_1_)
- Overrides:
playerTouch
in classEntity
-
getName
public ITextComponent getName()
-
isAttackable
public boolean isAttackable()
- Overrides:
isAttackable
in classEntity
-
changeDimension
@Nullable public Entity changeDimension(ServerWorld p_241206_1_, ITeleporter teleporter)
- Overrides:
changeDimension
in classEntity
-
getItem
public ItemStack getItem()
-
setItem
public void setItem(ItemStack p_92058_1_)
-
onSyncedDataUpdated
public void onSyncedDataUpdated(DataParameter<?> p_184206_1_)
- Overrides:
onSyncedDataUpdated
in classEntity
-
getOwner
@Nullable public java.util.UUID getOwner()
-
setOwner
public void setOwner(@Nullable java.util.UUID p_200217_1_)
-
getThrower
@Nullable public java.util.UUID getThrower()
-
setThrower
public void setThrower(@Nullable java.util.UUID p_200216_1_)
-
getAge
public int getAge()
-
setDefaultPickUpDelay
public void setDefaultPickUpDelay()
-
setNoPickUpDelay
public void setNoPickUpDelay()
-
setNeverPickUp
public void setNeverPickUp()
-
setPickUpDelay
public void setPickUpDelay(int p_174867_1_)
-
hasPickUpDelay
public boolean hasPickUpDelay()
-
setExtendedLifetime
public void setExtendedLifetime()
-
makeFakeItem
public void makeFakeItem()
-
getSpin
public float getSpin(float p_234272_1_)
-
getAddEntityPacket
public IPacket<?> getAddEntityPacket()
- Specified by:
getAddEntityPacket
in classEntity
-
copy
public ItemEntity copy()
-
-