public abstract class EntityLivingBase extends Entity
addedToChunk, cachedUniqueIdString, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, collided, collidedHorizontally, collidedVertically, dataManager, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, fallDistance, firstUpdate, FLAGS, forceSpawn, glowing, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isDead, isImmuneToFire, isInWeb, lastPortalPos, lastPortalVec, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, rideCooldown, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, teleportDirection, ticksExisted, timeUntilPortal, updateBlocked, velocityChanged, width, world
Constructor and Description |
---|
EntityLivingBase(World worldIn) |
Modifier and Type | Method and Description |
---|---|
void |
addPotionEffect(PotionEffect potioneffectIn) |
protected float |
applyArmorCalculations(DamageSource source,
float damage) |
protected void |
applyEntityAttributes() |
protected float |
applyPotionDamageCalculations(DamageSource source,
float damage) |
static boolean |
areAllPotionsAmbient(java.util.Collection<PotionEffect> potionEffects) |
boolean |
attackable() |
boolean |
attackEntityAsMob(Entity entityIn) |
boolean |
attackEntityFrom(DamageSource source,
float amount) |
boolean |
attemptTeleport(double x,
double y,
double z) |
protected void |
blockUsingShield(EntityLivingBase p_190629_1_) |
boolean |
canBeCollidedWith() |
boolean |
canBeHitWithPotion() |
boolean |
canBePushed() |
private boolean |
canBlockDamageSource(DamageSource damageSourceIn) |
boolean |
canBreatheUnderwater() |
protected boolean |
canDropLoot() |
boolean |
canEntityBeSeen(Entity entityIn) |
private boolean |
canGoThroughtTrapDoorOnLadder(BlockPos pos,
IBlockState state) |
private boolean |
checkTotemDeathProtection(DamageSource p_190628_1_) |
void |
clearActivePotions() |
protected void |
collideWithEntity(Entity entityIn) |
protected void |
collideWithNearbyEntities() |
void |
curePotionEffects(ItemStack curativeItem)
Removes all potion effects that have curativeItem as a curative item for its effect
|
protected void |
damageArmor(float damage) |
protected void |
damageEntity(DamageSource damageSrc,
float damageAmount) |
protected void |
damageShield(float damage) |
protected int |
decreaseAirSupply(int air) |
void |
dismountEntity(Entity entityIn) |
void |
dismountRidingEntity() |
protected void |
dropEquipment(boolean wasRecentlyHit,
int lootingModifier) |
protected void |
dropFewItems(boolean wasRecentlyHit,
int lootingModifier) |
protected void |
dropLoot(boolean wasRecentlyHit,
int lootingModifier,
DamageSource source) |
protected void |
entityInit() |
void |
fall(float distance,
float damageMultiplier) |
protected void |
frostWalk(BlockPos pos) |
float |
getAbsorptionAmount() |
EnumHand |
getActiveHand() |
ItemStack |
getActiveItemStack() |
PotionEffect |
getActivePotionEffect(Potion potionIn) |
java.util.Collection<PotionEffect> |
getActivePotionEffects() |
java.util.Map<Potion,PotionEffect> |
getActivePotionMap() |
float |
getAIMoveSpeed() |
boolean |
getAlwaysRenderNameTagForRender() |
abstract java.lang.Iterable<ItemStack> |
getArmorInventoryList() |
private int |
getArmSwingAnimationEnd() |
int |
getArrowCountInEntity() |
EntityLivingBase |
getAttackingEntity() |
AbstractAttributeMap |
getAttributeMap() |
<T> T |
getCapability(Capability<T> capability,
EnumFacing facing)
Retrieves the handler for the capability requested on the specific side.
|
CombatTracker |
getCombatTracker() |
EnumCreatureAttribute |
getCreatureAttribute() |
protected SoundEvent |
getDeathSound() |
IAttributeInstance |
getEntityAttribute(IAttribute attribute) |
protected int |
getExperiencePoints(EntityPlayer player) |
protected SoundEvent |
getFallSound(int heightIn) |
float |
getHealth() |
ItemStack |
getHeldItem(EnumHand hand) |
ItemStack |
getHeldItemMainhand() |
ItemStack |
getHeldItemOffhand() |
protected SoundEvent |
getHurtSound(DamageSource damageSourceIn) |
int |
getIdleTime() |
int |
getItemInUseCount() |
int |
getItemInUseMaxCount() |
abstract ItemStack |
getItemStackFromSlot(EntityEquipmentSlot slotIn) |
protected float |
getJumpUpwardsMotion() |
EntityLivingBase |
getLastAttackedEntity() |
int |
getLastAttackedEntityTime() |
DamageSource |
getLastDamageSource() |
Vec3d |
getLook(float partialTicks) |
float |
getMaxHealth() |
abstract EnumHandSide |
getPrimaryHand() |
EntityLivingBase |
getRevengeTarget() |
int |
getRevengeTimer() |
java.util.Random |
getRNG() |
float |
getRotationYawHead() |
protected float |
getSoundPitch() |
protected float |
getSoundVolume() |
float |
getSwingProgress(float partialTickTime) |
int |
getTicksElytraFlying() |
int |
getTotalArmorValue() |
protected float |
getWaterSlowDown() |
protected void |
handleJumpLava() |
protected void |
handleJumpWater() |
void |
handleStatusUpdate(byte id) |
boolean |
hasCapability(Capability<?> capability,
EnumFacing facing)
Determines if this object has support for the capability in question on the specific side.
|
boolean |
hasItemInSlot(EntityEquipmentSlot p_190630_1_) |
void |
heal(float healAmount) |
boolean |
isActiveItemStackBlocking() |
boolean |
isChild() |
boolean |
isElytraFlying() |
boolean |
isEntityAlive() |
boolean |
isEntityUndead() |
boolean |
isHandActive() |
protected boolean |
isMovementBlocked() |
boolean |
isOnLadder() |
protected boolean |
isPlayer() |
boolean |
isPlayerSleeping() |
boolean |
isPotionActive(Potion potionIn) |
boolean |
isPotionApplicable(PotionEffect potioneffectIn) |
boolean |
isServerWorld() |
protected void |
jump() |
void |
knockBack(Entity entityIn,
float strength,
double xRatio,
double zRatio) |
protected void |
markPotionsDirty() |
protected void |
markVelocityChanged() |
void |
moveRelative(float strafe,
float up,
float forward,
float friction) |
void |
notifyDataManagerChange(DataParameter<?> key) |
protected void |
onChangedPotionEffect(PotionEffect id,
boolean p_70695_2_) |
void |
onDeath(DamageSource cause) |
protected void |
onDeathUpdate() |
void |
onEntityUpdate() |
protected void |
onFinishedPotionEffect(PotionEffect effect) |
void |
onItemPickup(Entity entityIn,
int quantity) |
protected void |
onItemUseFinish() |
void |
onKillCommand() |
void |
onLivingUpdate() |
protected void |
onNewPotionEffect(PotionEffect id) |
void |
onUpdate() |
protected void |
outOfWorld() |
void |
performHurtAnimation() |
protected void |
playEquipSound(ItemStack stack) |
protected void |
playHurtSound(DamageSource source) |
void |
readEntityFromNBT(NBTTagCompound compound) |
PotionEffect |
removeActivePotionEffect(Potion potioneffectin) |
void |
removePotionEffect(Potion potionIn) |
void |
renderBrokenItemStack(ItemStack stack) |
void |
resetActiveHand() |
protected void |
resetPotionEffectMetadata() |
void |
sendEndCombat() |
void |
sendEnterCombat() |
void |
setAbsorptionAmount(float amount) |
void |
setActiveHand(EnumHand hand) |
void |
setAIMoveSpeed(float speedIn) |
void |
setArrowCountInEntity(int count) |
void |
setHealth(float health) |
void |
setHeldItem(EnumHand hand,
ItemStack stack) |
abstract void |
setItemStackToSlot(EntityEquipmentSlot slotIn,
ItemStack stack) |
void |
setJumping(boolean jumping) |
void |
setLastAttackedEntity(Entity entityIn) |
void |
setPartying(BlockPos pos,
boolean p_191987_2_) |
void |
setPositionAndRotationDirect(double x,
double y,
double z,
float yaw,
float pitch,
int posRotationIncrements,
boolean teleport) |
void |
setRenderYawOffset(float offset) |
void |
setRevengeTarget(EntityLivingBase livingBase) |
void |
setRotationYawHead(float rotation) |
void |
setSprinting(boolean sprinting) |
boolean |
shouldRiderFaceForward(EntityPlayer player)
Returns true if the entity's rider (EntityPlayer) should face forward when mounted.
|
void |
stopActiveHand() |
void |
swingArm(EnumHand hand) |
void |
travel(float strafe,
float vertical,
float forward) |
protected void |
updateActiveHand() |
protected void |
updateArmSwingProgress() |
protected float |
updateDistance(float p_110146_1_,
float p_110146_2_) |
private void |
updateElytra() |
protected void |
updateEntityActionState() |
protected void |
updateFallState(double y,
boolean onGroundIn,
IBlockState state,
BlockPos pos) |
protected void |
updateItemUse(ItemStack stack,
int eatingParticleCount) |
protected void |
updatePotionEffects() |
protected void |
updatePotionMetadata() |
void |
updateRidden() |
void |
writeEntityToNBT(NBTTagCompound compound) |
addEntityCrashInfo, addPassenger, addTag, addTrackingPlayer, addVelocity, applyEnchantments, applyEntityCollision, applyOrientationToEntity, applyPlayerInteraction, awardKillScore, canBeAttackedWithItem, canBeRidden, canExplosionDestroyBlock, canFitPassenger, canPassengerSteer, canRenderOnFire, canRiderInteract, canTrample, canTriggerWalking, canUseCommand, changeDimension, changeDimension, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, decrementTimeUntilPortal, deserializeNBT, doBlockCollisions, doesEntityNotTriggerPressurePlate, doWaterSplashEffect, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, getAdjustedHorizontalFacing, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCachedUniqueIdString, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, getCommandStats, getControllingPassenger, getCustomNameTag, getDataManager, getDisplayName, getDistance, getDistance, getDistanceSq, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getEntityBoundingBox, getEntityData, getEntityId, getEntityString, getEntityWorld, getEquipmentAndArmor, getExplosionResistance, getEyeHeight, getFireImmuneTicks, getFlag, getForward, getHeldEquipment, getHorizontalFacing, getHoverEvent, getIsInvulnerable, getLastPortalVec, getLookVec, getLowestRidingEntity, getMaxFallHeight, getMaxInPortalTime, getMirroredYaw, getMountedYOffset, getName, getParts, getPassengers, getPersistentID, getPickedResult, getPitchYaw, getPortalCooldown, getPosition, getPositionEyes, getPositionVector, getPushReaction, getRecursivePassengers, getRecursivePassengersByType, getRenderBoundingBox, getRenderDistanceWeight, getRidingEntity, getRotatedYaw, getServer, getSoundCategory, getSplashSound, getSwimSound, getTags, getTeam, getTeleportDirection, getUniqueID, getVectorForRotation, getYOffset, handleWaterMovement, hasCustomName, hashCode, hasNoGravity, hitByEntity, ignoreItemEntityData, isAddedToWorld, isBeingRidden, isBurning, isCreatureType, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isGlowing, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isNonBoss, isOffsetPositionInLiquid, isOnSameTeam, isOnScoreboardTeam, isOutsideBorder, isOverWater, isPassenger, isPushedByWater, isRiding, isRidingOrBeingRiddenBy, isRidingSameEntity, isSilent, isSneaking, isSpectatedByPlayer, isSprinting, isWet, makeFlySound, move, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onAddedToWorld, onCollideWithPlayer, onInsideBlock, onKillEntity, onRemovedFromWorld, onStruckByLightning, playFlySound, playSound, playStepSound, preparePlayerToSpawn, processInitialInteract, pushOutOfBlocks, rayTrace, readFromNBT, registerFixes, removePassenger, removePassengers, removeTag, removeTrackingPlayer, replaceItemInInventory, resetEntityId, resetPositionToBB, sendCommandFeedback, sendMessage, serializeNBT, setAir, setAlwaysRenderNameTag, setCommandStat, setCommandStats, setCustomNameTag, setDead, setDropItemsWhenDead, setEntityBoundingBox, setEntityId, setEntityInvulnerable, setFire, setFlag, setGlowing, setInvisible, setInWeb, setLocationAndAngles, setNoGravity, setOnFireFromLava, setOutsideBorder, setPortal, setPosition, setPositionAndRotation, setPositionAndUpdate, setPositionNonDirty, setRenderDistanceWeight, setRotation, setSilent, setSize, setSneaking, setUniqueId, setVelocity, setWorld, shouldDismountInWater, shouldRenderInPass, shouldRiderSit, shouldSetPosAfterLoading, spawnRunningParticles, startRiding, startRiding, toString, turn, updatePassenger, writeToNBT, writeToNBTAtomically, writeToNBTOptional
private static final org.apache.logging.log4j.Logger LOGGER
private static final java.util.UUID SPRINTING_SPEED_BOOST_ID
private static final AttributeModifier SPRINTING_SPEED_BOOST
public static final IAttribute SWIM_SPEED
protected static final DataParameter<java.lang.Byte> HAND_STATES
private static final DataParameter<java.lang.Float> HEALTH
private static final DataParameter<java.lang.Integer> POTION_EFFECTS
private static final DataParameter<java.lang.Boolean> HIDE_PARTICLES
private static final DataParameter<java.lang.Integer> ARROW_COUNT_IN_ENTITY
private AbstractAttributeMap attributeMap
private final CombatTracker _combatTracker
private final java.util.Map<Potion,PotionEffect> activePotionsMap
private final NonNullList<ItemStack> handInventory
private final NonNullList<ItemStack> armorArray
public boolean isSwingInProgress
public EnumHand swingingHand
public int swingProgressInt
public int arrowHitTimer
public int hurtTime
public int maxHurtTime
public float attackedAtYaw
public int deathTime
public float prevSwingProgress
public float swingProgress
protected int ticksSinceLastSwing
public float prevLimbSwingAmount
public float limbSwingAmount
public float limbSwing
public int maxHurtResistantTime
public float prevCameraPitch
public float cameraPitch
public float randomUnused2
public float randomUnused1
public float renderYawOffset
public float prevRenderYawOffset
public float rotationYawHead
public float prevRotationYawHead
public float jumpMovementFactor
protected EntityPlayer attackingPlayer
protected int recentlyHit
protected boolean dead
protected int idleTime
protected float prevOnGroundSpeedFactor
protected float onGroundSpeedFactor
protected float movedDistance
protected float prevMovedDistance
protected float unused180
protected int scoreValue
protected float lastDamage
protected boolean isJumping
public float moveStrafing
public float moveVertical
public float moveForward
public float randomYawVelocity
protected int newPosRotationIncrements
protected double interpTargetX
protected double interpTargetY
protected double interpTargetZ
protected double interpTargetYaw
protected double interpTargetPitch
private boolean potionsNeedUpdate
private EntityLivingBase revengeTarget
private int revengeTimer
private EntityLivingBase lastAttackedEntity
private int lastAttackedEntityTime
private float landMovementFactor
private int jumpTicks
private float absorptionAmount
protected ItemStack activeItemStack
protected int activeItemStackUseCount
protected int ticksElytraFlying
private BlockPos prevBlockpos
private DamageSource lastDamageSource
private long lastDamageStamp
private final IItemHandlerModifiable handHandler
private final IItemHandlerModifiable armorHandler
private final IItemHandler joinedHandler
public EntityLivingBase(World worldIn)
public void onKillCommand()
onKillCommand
in class Entity
protected void entityInit()
entityInit
in class Entity
protected void applyEntityAttributes()
protected void updateFallState(double y, boolean onGroundIn, IBlockState state, BlockPos pos)
updateFallState
in class Entity
public boolean canBreatheUnderwater()
public void onEntityUpdate()
onEntityUpdate
in class Entity
protected void frostWalk(BlockPos pos)
public boolean isChild()
protected void onDeathUpdate()
protected boolean canDropLoot()
protected int decreaseAirSupply(int air)
protected int getExperiencePoints(EntityPlayer player)
protected boolean isPlayer()
public java.util.Random getRNG()
@Nullable public EntityLivingBase getRevengeTarget()
public int getRevengeTimer()
public void setRevengeTarget(@Nullable EntityLivingBase livingBase)
public EntityLivingBase getLastAttackedEntity()
public int getLastAttackedEntityTime()
public void setLastAttackedEntity(Entity entityIn)
public int getIdleTime()
protected void playEquipSound(ItemStack stack)
public void writeEntityToNBT(NBTTagCompound compound)
writeEntityToNBT
in class Entity
public void readEntityFromNBT(NBTTagCompound compound)
readEntityFromNBT
in class Entity
protected void updatePotionEffects()
protected void updatePotionMetadata()
public static boolean areAllPotionsAmbient(java.util.Collection<PotionEffect> potionEffects)
protected void resetPotionEffectMetadata()
public void clearActivePotions()
public java.util.Collection<PotionEffect> getActivePotionEffects()
public java.util.Map<Potion,PotionEffect> getActivePotionMap()
public boolean isPotionActive(Potion potionIn)
@Nullable public PotionEffect getActivePotionEffect(Potion potionIn)
public void addPotionEffect(PotionEffect potioneffectIn)
public boolean isPotionApplicable(PotionEffect potioneffectIn)
public boolean isEntityUndead()
@Nullable public PotionEffect removeActivePotionEffect(@Nullable Potion potioneffectin)
public void removePotionEffect(Potion potionIn)
protected void onNewPotionEffect(PotionEffect id)
protected void onChangedPotionEffect(PotionEffect id, boolean p_70695_2_)
protected void onFinishedPotionEffect(PotionEffect effect)
public void heal(float healAmount)
public final float getHealth()
public void setHealth(float health)
public boolean attackEntityFrom(DamageSource source, float amount)
attackEntityFrom
in class Entity
protected void blockUsingShield(EntityLivingBase p_190629_1_)
private boolean checkTotemDeathProtection(DamageSource p_190628_1_)
@Nullable public DamageSource getLastDamageSource()
protected void playHurtSound(DamageSource source)
private boolean canBlockDamageSource(DamageSource damageSourceIn)
public void renderBrokenItemStack(ItemStack stack)
public void onDeath(DamageSource cause)
protected void dropLoot(boolean wasRecentlyHit, int lootingModifier, DamageSource source)
protected void dropEquipment(boolean wasRecentlyHit, int lootingModifier)
public void knockBack(Entity entityIn, float strength, double xRatio, double zRatio)
@Nullable protected SoundEvent getHurtSound(DamageSource damageSourceIn)
@Nullable protected SoundEvent getDeathSound()
protected SoundEvent getFallSound(int heightIn)
protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier)
public boolean isOnLadder()
private boolean canGoThroughtTrapDoorOnLadder(BlockPos pos, IBlockState state)
public boolean isEntityAlive()
isEntityAlive
in class Entity
public void performHurtAnimation()
performHurtAnimation
in class Entity
public int getTotalArmorValue()
protected void damageArmor(float damage)
protected void damageShield(float damage)
protected float applyArmorCalculations(DamageSource source, float damage)
protected float applyPotionDamageCalculations(DamageSource source, float damage)
protected void damageEntity(DamageSource damageSrc, float damageAmount)
public CombatTracker getCombatTracker()
@Nullable public EntityLivingBase getAttackingEntity()
public final float getMaxHealth()
public final int getArrowCountInEntity()
public final void setArrowCountInEntity(int count)
private int getArmSwingAnimationEnd()
public void swingArm(EnumHand hand)
public void handleStatusUpdate(byte id)
handleStatusUpdate
in class Entity
protected void outOfWorld()
outOfWorld
in class Entity
protected void updateArmSwingProgress()
public IAttributeInstance getEntityAttribute(IAttribute attribute)
public AbstractAttributeMap getAttributeMap()
public EnumCreatureAttribute getCreatureAttribute()
public ItemStack getHeldItemMainhand()
public ItemStack getHeldItemOffhand()
public boolean hasItemInSlot(EntityEquipmentSlot p_190630_1_)
public abstract java.lang.Iterable<ItemStack> getArmorInventoryList()
getArmorInventoryList
in class Entity
public abstract ItemStack getItemStackFromSlot(EntityEquipmentSlot slotIn)
public abstract void setItemStackToSlot(EntityEquipmentSlot slotIn, ItemStack stack)
setItemStackToSlot
in class Entity
public void setSprinting(boolean sprinting)
setSprinting
in class Entity
protected float getSoundVolume()
protected float getSoundPitch()
protected boolean isMovementBlocked()
public void dismountEntity(Entity entityIn)
public boolean getAlwaysRenderNameTagForRender()
getAlwaysRenderNameTagForRender
in class Entity
protected float getJumpUpwardsMotion()
protected void jump()
protected void handleJumpWater()
protected void handleJumpLava()
protected float getWaterSlowDown()
public void travel(float strafe, float vertical, float forward)
public float getAIMoveSpeed()
public void setAIMoveSpeed(float speedIn)
public boolean attackEntityAsMob(Entity entityIn)
public boolean isPlayerSleeping()
protected float updateDistance(float p_110146_1_, float p_110146_2_)
public void onLivingUpdate()
private void updateElytra()
protected void updateEntityActionState()
protected void collideWithNearbyEntities()
protected void collideWithEntity(Entity entityIn)
public void dismountRidingEntity()
dismountRidingEntity
in class Entity
public void updateRidden()
updateRidden
in class Entity
public void setPositionAndRotationDirect(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean teleport)
setPositionAndRotationDirect
in class Entity
public void setJumping(boolean jumping)
public void onItemPickup(Entity entityIn, int quantity)
public boolean canEntityBeSeen(Entity entityIn)
public float getSwingProgress(float partialTickTime)
public boolean isServerWorld()
public boolean canBeCollidedWith()
canBeCollidedWith
in class Entity
public boolean canBePushed()
canBePushed
in class Entity
protected void markVelocityChanged()
markVelocityChanged
in class Entity
public float getRotationYawHead()
getRotationYawHead
in class Entity
public void setRotationYawHead(float rotation)
setRotationYawHead
in class Entity
public void setRenderYawOffset(float offset)
setRenderYawOffset
in class Entity
public float getAbsorptionAmount()
public void setAbsorptionAmount(float amount)
public void sendEnterCombat()
public void sendEndCombat()
protected void markPotionsDirty()
public void curePotionEffects(ItemStack curativeItem)
curativeItem
- The itemstack we are using to cure potion effectspublic boolean shouldRiderFaceForward(EntityPlayer player)
player
- The player who is riding the entity.public abstract EnumHandSide getPrimaryHand()
public boolean isHandActive()
public EnumHand getActiveHand()
protected void updateActiveHand()
public void setActiveHand(EnumHand hand)
public void notifyDataManagerChange(DataParameter<?> key)
notifyDataManagerChange
in class Entity
protected void updateItemUse(ItemStack stack, int eatingParticleCount)
protected void onItemUseFinish()
public ItemStack getActiveItemStack()
public int getItemInUseCount()
public int getItemInUseMaxCount()
public void stopActiveHand()
public void resetActiveHand()
public boolean isActiveItemStackBlocking()
public boolean isElytraFlying()
public int getTicksElytraFlying()
public boolean attemptTeleport(double x, double y, double z)
public boolean canBeHitWithPotion()
@Nullable public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing)
ICapabilityProvider
Basically, this method functions analogously to Map.get(Object)
.
getCapability
in interface ICapabilityProvider
getCapability
in class Entity
capability
- The capability to checkfacing
- The Side to check from,
CAN BE NULL. Null is defined to represent 'internal' or 'self'ICapabilityProvider.hasCapability(Capability, EnumFacing)
would return true.public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing)
ICapabilityProvider
ICapabilityProvider.getCapability(Capability, EnumFacing)
.
Basically, this method functions analogously to Map.containsKey(Object)
.
Example: A Pipe getting a cover placed on one side causing it lose the Inventory attachment function for that side.
This is a light weight version of getCapability, intended for metadata uses.
hasCapability
in interface ICapabilityProvider
hasCapability
in class Entity
capability
- The capability to checkfacing
- The Side to check from:
CAN BE NULL. Null is defined to represent 'internal' or 'self'ICapabilityProvider.getCapability(Capability, EnumFacing)
must not return null.public boolean attackable()
public void setPartying(BlockPos pos, boolean p_191987_2_)
public void moveRelative(float strafe, float up, float forward, float friction)
moveRelative
in class Entity