MCPlayerEntity #MC玩家实体

这个类由mod-id为crafttweaker的模组添加. 因此,如果要使用此功能,则需要安装此mod。

导入相关包

如果遇到任何问题(例如强制转换数组),则可能需要导入软件包,因此,最好的方式就是导入包支持。

crafttweaker.api.entity.player.MCPlayerEntity

方法

addExhaustion #增加饥饿值

通过所提供的数值增加饥饿值

myMCPlayerEntity.addExhaustion(exhaustion as float);
参数类型描述
exhaustionfloatNo description provided

addExperienceLevel #提升经验等级

提升此玩家的经验等级

myMCPlayerEntity.addExperienceLevel(levels as int);
参数类型描述
levelsintNo description provided

addItemStackToInventory #在背包中添加物品堆叠

返回为布尔值

myMCPlayerEntity.addItemStackToInventory(p_191521_1_ as crafttweaker.api.item.IItemStack);
参数类型描述
p191521_1crafttweaker.api.item.IItemStackNo description provided

addMovementStat #添加移动统计

为移动统计添加一个值——如跑步、步行、游泳或攀登。

myMCPlayerEntity.addMovementStat(p_71000_1_ as double, p_71000_3_ as double, p_71000_5_ as double);
参数类型描述
p71000_1doubleNo description provided
p71000_3doubleNo description provided
p71000_5doubleNo description provided

addPotionEffect #添加药水效果

返回为布尔值

myMCPlayerEntity.addPotionEffect(effectInstanceIn as crafttweaker.api.potion.MCPotionEffectInstance);
参数类型描述
effectInstanceIn #效果实例crafttweaker.api.potion.MCPotionEffectInstanceNo description provided

addScore #添加分数

添加到玩家分数

myMCPlayerEntity.addScore(scoreIn as int);
参数类型描述
scoreInintNo description provided

addTag #添加tag

返回为布尔值

myMCPlayerEntity.addTag(tag as String);
参数类型描述
tagStringNo description provided

addVelocity #增加速度

为实体的当前速度添加一个值,并设置为true

myMCPlayerEntity.addVelocity(x as double, y as double, z as double);
参数类型描述
xdoubleNo description provided
ydoubleNo description provided
zdoubleNo description provided

allowLogging #允许记录日志

返回为布尔值

myMCPlayerEntity.allowLogging();

attackable #可攻击的

返回为布尔值

myMCPlayerEntity.attackable();

attemptTeleport #是否尝试传送

返回为布尔值

myMCPlayerEntity.attemptTeleport(p_213373_1_ as double, p_213373_3_ as double, p_213373_5_ as double, p_213373_7_ as boolean);
参数类型描述
p213373_1doubleNo description provided
p213373_3doubleNo description provided
p213373_5doubleNo description provided
p213373_7booleanNo description provided

baseTick #基础游戏刻

Gets called every tick from main Entity class #从主要实体类获取所有游戏刻

myMCPlayerEntity.baseTick();

canAttackPlayer #可以攻击玩家

返回为布尔值

myMCPlayerEntity.canAttackPlayer(other as crafttweaker.api.entity.player.MCPlayerEntity);
参数类型描述
othercrafttweaker.api.entity.player.MCPlayerEntityNo description provided

canBeAttackedWithItem #可以被物体攻击

如果可能用物品攻击该实体,则返回true

返回为布尔值

myMCPlayerEntity.canBeAttackedWithItem();

canBeCollidedWith #具有碰撞箱

如果此实体可以阻止其他实体的移动,则反为真

返回为布尔值

myMCPlayerEntity.canBeCollidedWith();

canBeHitWithPotion #可以被药水瓶击中

如果实体为盔甲架,则返回false 如果是其他实体生物则返回为true

返回为布尔值

myMCPlayerEntity.canBeHitWithPotion();

canBePushed #可以被推动

如果该实体在与其他实体碰撞时可以被推动,则返回值true

返回为布尔值

myMCPlayerEntity.canBePushed();

canBeRiddenInWater #可以潜水

返回为布尔值

myMCPlayerEntity.canBeRiddenInWater();

canBreatheUnderwater

返回为布尔值

myMCPlayerEntity.canBreatheUnderwater();

canEat #可以进食

返回为布尔值

myMCPlayerEntity.canEat(ignoreHunger as boolean);
参数类型描述
ignoreHungerbooleanNo description provided

canHarvestBlock #可以破坏方块

返回为布尔值

myMCPlayerEntity.canHarvestBlock(state as crafttweaker.api.block.MCBlockState);
参数类型描述
statecrafttweaker.api.block.MCBlockStateNo description provided

canPassengerSteer #可以乘坐

返回为布尔值

myMCPlayerEntity.canPassengerSteer();

canPlayerEdit #可以由玩家编辑

返回此玩家是否可以在某个地点使用给定的堆栈修改方块。

查询位置是 {@code pos.offset(facing.getOpposite()}。 返回:此玩家是否可以修改当前世界中查询的位置 @see ItemStack#canPlaceOn(Block) @see ItemStack#canEditBlocks() @see PlayerCapabilities#allowededge

返回为布尔值

myMCPlayerEntity.canPlayerEdit(pos as crafttweaker.api.util.BlockPos, facing as crafttweaker.api.util.Direction, stack as crafttweaker.api.item.IItemStack);
参数类型描述
crafttweaker.api.util.BlockPosNo description provided
方向crafttweaker.api.util.DirectionNo description provided
stackcrafttweaker.api.item.IItemStackNo description provided

canRenderOnFire #是否能被渲染为着火

返回该实体能否被渲染为着火

返回为布尔值

myMCPlayerEntity.canRenderOnFire();

canRiderInteract #是否可以互动

返回为布尔值

myMCPlayerEntity.canRiderInteract();

canSwim #是否可以游泳

返回为布尔值

myMCPlayerEntity.canSwim();

canTrample #是否能被踩踏

返回为布尔值

myMCPlayerEntity.canTrample(state as crafttweaker.api.block.MCBlockState, pos as crafttweaker.api.util.BlockPos, fallDistance as float);
参数类型描述
statecrafttweaker.api.block.MCBlockStateNo description provided
crafttweaker.api.util.BlockPosNo description provided
下落距离floatNo description provided

canUpdate #是否能被更新

返回为布尔值

myMCPlayerEntity.canUpdate();
myMCPlayerEntity.canUpdate(值为布尔型);
参数类型描述
valuebooleanNo description provided

canUseCommandBlock #是否可以使用命令方块

返回为布尔值

myMCPlayerEntity.canUseCommandBlock();

clearActivePotions #清除药水效果

返回为布尔值

myMCPlayerEntity.clearActivePotions();

clearBedPosition #清除床的位置

myMCPlayerEntity.clearBedPosition();

closeScreen #关闭屏幕

把当前合成栏设置回2x2个格子

myMCPlayerEntity.closeScreen();

curePotionEffects #清除药水效果

返回为布尔值

myMCPlayerEntity.curePotionEffects(治疗的效果为 crafttweaker.api.item.IItemStack);
参数类型描述
治疗的效果crafttweaker.api.item.IItemStackNo description provided

detach #分离

myMCPlayerEntity.detach();

disableShield #禁用盾

myMCPlayerEntity.disableShield(p_190777_1_ 为布尔值);
参数类型描述
p190777_1booleanNo description provided

doesEntityNotTriggerPressurePlate #实体是否会触发压力板

返回此实体是否会触发压力板或绊线。

返回为布尔值

myMCPlayerEntity.doesEntityNotTriggerPressurePlate();

equals #等于

返回为布尔值

myMCPlayerEntity.equals(p_equals_1_ as Object);
参数类型描述
pequals_1ObjectNo description provided

extinguish

Removes fire from entity.

myMCPlayerEntity.extinguish();

fall

myMCPlayerEntity.fall(distance as float, damageMultiplier as float);
参数类型描述
distancefloatNo description provided
damageMultiplierfloatNo description provided

findAmmo

Returns crafttweaker.api.item.IItemStack

myMCPlayerEntity.findAmmo(shootable as crafttweaker.api.item.IItemStack);
参数类型描述
shootablecrafttweaker.api.item.IItemStackNo description provided

func_213300_bk

返回为布尔值

myMCPlayerEntity.func_213300_bk();

func_213312_b

myMCPlayerEntity.func_213312_b(p_213312_1_ as double, p_213312_3_ as double, p_213312_5_ as double);
参数类型描述
p213312_1doubleNo description provided
p213312_3doubleNo description provided
p213312_5doubleNo description provided

func_213314_bj

返回为布尔值

myMCPlayerEntity.func_213314_bj();

func_213343_cS

Returns float

myMCPlayerEntity.func_213343_cS();

func_213365_e

返回为布尔值

myMCPlayerEntity.func_213365_e(itemstackIn as crafttweaker.api.item.IItemStack);
参数类型描述
itemstackIncrafttweaker.api.item.IItemStackNo description provided

getAIMoveSpeed

the movespeed used for the new AI system

Returns float

myMCPlayerEntity.getAIMoveSpeed();

getAbsorptionAmount

Returns the amount of health added by the Absorption effect.

Returns float

myMCPlayerEntity.getAbsorptionAmount();

getActiveItemStack

Returns crafttweaker.api.item.IItemStack

myMCPlayerEntity.getActiveItemStack();

getActivePotionEffect

returns the PotionEffect for the supplied Potion if it is active, null otherwise.

Returns crafttweaker.api.potion.MCPotionEffectInstance

myMCPlayerEntity.getActivePotionEffect(potionIn as crafttweaker.api.potion.MCPotionEffect);
参数类型描述
potionIncrafttweaker.api.potion.MCPotionEffectNo description provided

getActivePotionEffects

Returns Collection<crafttweaker.api.potion.MCPotionEffectInstance>

myMCPlayerEntity.getActivePotionEffects();

getAdjustedHorizontalFacing

Gets the horizontal facing direction of this Entity, adjusted to take specially-treated entity types into account.

Returns crafttweaker.api.util.Direction

myMCPlayerEntity.getAdjustedHorizontalFacing();

getAir

返回为int值

myMCPlayerEntity.getAir();

getAlwaysRenderNameTagForRender

返回为布尔值

myMCPlayerEntity.getAlwaysRenderNameTagForRender();

getArrowCountInEntity

返回为int值

myMCPlayerEntity.getArrowCountInEntity();

getBedDirection

gets the Direction for the camera if this entity is sleeping

Returns crafttweaker.api.util.Direction

myMCPlayerEntity.getBedDirection();

getBedLocation

Returns crafttweaker.api.util.BlockPos

myMCPlayerEntity.getBedLocation();

getBlockState

返回值 crafttweaker.api.block.MCBlockState

myMCPlayerEntity.getBlockState();

getBrightness

Gets how bright this entity is.

Returns float

myMCPlayerEntity.getBrightness();

getBrightnessForRender

返回为int值

myMCPlayerEntity.getBrightnessForRender();

getCachedUniqueIdString

返回字符串[String]

myMCPlayerEntity.getCachedUniqueIdString();

getClassification

Returns crafttweaker.api.entity.MCEntityClassification

myMCPlayerEntity.getClassification(forSpawnCount as boolean);
参数类型描述
forSpawnCountbooleanNo description provided

getCollisionBorderSize

Returns float

myMCPlayerEntity.getCollisionBorderSize();

getCooldownPeriod

Returns float

myMCPlayerEntity.getCooldownPeriod();

getCooledAttackStrength

Returns the percentage of attack power available based on the cooldown (zero to one).

Returns float

myMCPlayerEntity.getCooledAttackStrength(adjustTicks as float);
参数类型描述
adjustTicksfloatNo description provided

getDigSpeed

Returns float

myMCPlayerEntity.getDigSpeed(state as crafttweaker.api.block.MCBlockState);
参数类型描述
statecrafttweaker.api.block.MCBlockStateNo description provided

Returns float

myMCPlayerEntity.getDigSpeed(arg0 as crafttweaker.api.block.MCBlockState, arg1 as crafttweaker.api.util.BlockPos);
参数类型描述
arg0crafttweaker.api.block.MCBlockStateNo description provided
arg1crafttweaker.api.util.BlockPosNo description provided

getDistanceSq

Returns double

myMCPlayerEntity.getDistanceSq(x as double, y as double, z as double);
参数类型描述
xdoubleNo description provided
ydoubleNo description provided
zdoubleNo description provided

getEntityId

返回为int值

myMCPlayerEntity.getEntityId();

getEntityString

返回字符串[String]

myMCPlayerEntity.getEntityString();

getEyeHeight

Returns float

myMCPlayerEntity.getEyeHeight();

getFireTimer

返回为int值

myMCPlayerEntity.getFireTimer();

getHealth

Returns float

myMCPlayerEntity.getHealth();

getHeight

Returns float

myMCPlayerEntity.getHeight();

getHeldItemMainhand

Returns crafttweaker.api.item.IItemStack

myMCPlayerEntity.getHeldItemMainhand();

getHeldItemOffhand

Returns crafttweaker.api.item.IItemStack

myMCPlayerEntity.getHeldItemOffhand();

getHorizontalFacing

Gets the horizontal facing direction of this Entity.

Returns crafttweaker.api.util.Direction

myMCPlayerEntity.getHorizontalFacing();

getIdleTime

返回为int值

myMCPlayerEntity.getIdleTime();

getItemInUseCount

返回为int值

myMCPlayerEntity.getItemInUseCount();

getItemInUseMaxCount

返回为int值

myMCPlayerEntity.getItemInUseMaxCount();

getLastAttackedEntityTime

返回为int值

myMCPlayerEntity.getLastAttackedEntityTime();

getLuck

Returns float

myMCPlayerEntity.getLuck();

getMaxAir

返回为int值

myMCPlayerEntity.getMaxAir();

getMaxFallHeight

The maximum height from where the entity is alowed to jump (used in pathfinder)

返回为int值

myMCPlayerEntity.getMaxFallHeight();

getMaxHealth

Returns float

myMCPlayerEntity.getMaxHealth();

getMaxInPortalTime

Return the amount of time this entity should stay in a portal before being transported.

返回为int值

myMCPlayerEntity.getMaxInPortalTime();

getMountedYOffset

Returns the Y offset from the entity's position for any entity riding this one.

Returns double

myMCPlayerEntity.getMountedYOffset();

getPitch

Gets the current pitch of the entity.

Returns float

myMCPlayerEntity.getPitch(partialTicks as float);
参数类型描述
partialTicksfloatNo description provided

getPortalCooldown

Return the amount of cooldown before this entity can use a portal again.

返回为int值

myMCPlayerEntity.getPortalCooldown();

getPosition

Get the position in the world. {@code null} is not allowed! If you are not an entity in the world, return the coordinates 0, 0, 0

Returns crafttweaker.api.util.BlockPos

myMCPlayerEntity.getPosition();

getRenderScale

Returns float

myMCPlayerEntity.getRenderScale();

getRevengeTimer

返回为int值

myMCPlayerEntity.getRevengeTimer();

getRotationYawHead

Returns float

myMCPlayerEntity.getRotationYawHead();

getScore

返回为int值

myMCPlayerEntity.getScore();

getScoreboardName

Returns a String to use as this entity's name in the scoreboard/entity selector systems

返回字符串[String]

myMCPlayerEntity.getScoreboardName();

getSleepTimer

返回为int值

myMCPlayerEntity.getSleepTimer();

getSubmergedHeight

Returns double

myMCPlayerEntity.getSubmergedHeight();

getSwimAnimation

Returns float

myMCPlayerEntity.getSwimAnimation(partialTicks as float);
参数类型描述
partialTicksfloatNo description provided

getSwingProgress

Gets the progression of the swing animation, ranges from 0.0 to 1.0.

Returns float

myMCPlayerEntity.getSwingProgress(partialTickTime as float);
参数类型描述
partialTickTimefloatNo description provided

getTags

Returns Set

myMCPlayerEntity.getTags();

getTeleportDirection

Returns crafttweaker.api.util.Direction

myMCPlayerEntity.getTeleportDirection();

getTicksElytraFlying

返回为int值

myMCPlayerEntity.getTicksElytraFlying();

getTotalArmorValue

Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue

返回为int值

myMCPlayerEntity.getTotalArmorValue();

getWidth

Returns float

myMCPlayerEntity.getWidth();

getXPSeed

返回为int值

myMCPlayerEntity.getXPSeed();

getYOffset

Returns the Y Offset of this entity.

Returns double

myMCPlayerEntity.getYOffset();

getYaw

Gets the current yaw of the entity

Returns float

myMCPlayerEntity.getYaw(partialTicks as float);
参数类型描述
partialTicksfloatNo description provided

giveExperiencePoints

myMCPlayerEntity.giveExperiencePoints(p_195068_1_ as int);
参数类型描述
p195068_1intNo description provided

handleStatusUpdate

myMCPlayerEntity.handleStatusUpdate(id as byte);
参数类型描述
idbyteNo description provided

handleWaterMovement

Returns if this entity is in water and will end up adding the waters velocity to the entity

返回为布尔值

myMCPlayerEntity.handleWaterMovement();

hasCustomName

返回为布尔值

myMCPlayerEntity.hasCustomName();

hasNoGravity

返回为布尔值

myMCPlayerEntity.hasNoGravity();

hasPermissionLevel

返回为布尔值

myMCPlayerEntity.hasPermissionLevel(p_211513_1_ as int);
参数类型描述
p211513_1intNo description provided

hasReducedDebug

Whether the "reducedDebugInfo" option is active for this player.

返回为布尔值

myMCPlayerEntity.hasReducedDebug();

hashCode

返回为int值

myMCPlayerEntity.hashCode();

heal

Heal living entity (param: amount of half-hearts)

myMCPlayerEntity.heal(healAmount as float);
参数类型描述
healAmountfloatNo description provided

ignoreItemEntityData

Checks if players can use this entity to access operator (permission level 2) commands either directly or indirectly, such as give or setblock. A similar method exists for entities at {@link net.minecraft.tileentity.TileEntity#onlyOpsCanSetNbt()}.

For example, {@link net.minecraft.entity.item.EntityMinecartCommandBlock#ignoreItemEntityData() command block minecarts} and {@link net.minecraft.entity.item.EntityMinecartMobSpawner#ignoreItemEntityData() mob spawner minecarts} (spawning command block minecarts or drops) are considered accessible.

Returns: true if this entity offers ways for unauthorized players to use restricted commands

返回为布尔值

myMCPlayerEntity.ignoreItemEntityData();

isActiveItemStackBlocking

返回为布尔值

myMCPlayerEntity.isActiveItemStackBlocking();

isAddedToWorld

返回为布尔值

myMCPlayerEntity.isAddedToWorld();

isAlive

Returns true if the entity has not been .

返回为布尔值

myMCPlayerEntity.isAlive();

isAllowEdit

返回为布尔值

myMCPlayerEntity.isAllowEdit();

isBeingRidden

If at least 1 entity is riding this one

返回为布尔值

myMCPlayerEntity.isBeingRidden();

isBurning

Returns true if the entity is on fire. Used by render to add the fire effect on rendering.

返回为布尔值

myMCPlayerEntity.isBurning();

isChild

If Animal, checks if the age timer is negative

返回为布尔值

myMCPlayerEntity.isChild();

isCreative

返回为布尔值

myMCPlayerEntity.isCreative();

isCustomNameVisible

返回为布尔值

myMCPlayerEntity.isCustomNameVisible();

isElytraFlying

返回为布尔值

myMCPlayerEntity.isElytraFlying();

isEntityInsideOpaqueBlock

Checks if this entity is inside of an opaque block

返回为布尔值

myMCPlayerEntity.isEntityInsideOpaqueBlock();

isEntityUndead

Returns true if this entity is undead.

返回为布尔值

myMCPlayerEntity.isEntityUndead();

isGlowing

返回为布尔值

myMCPlayerEntity.isGlowing();

isHandActive

返回为布尔值

myMCPlayerEntity.isHandActive();

isImmuneToExplosions

返回为布尔值

myMCPlayerEntity.isImmuneToExplosions();

isImmuneToFire

返回为布尔值

myMCPlayerEntity.isImmuneToFire();

isInLava

返回为布尔值

myMCPlayerEntity.isInLava();

isInRangeToRender3d

返回为布尔值

myMCPlayerEntity.isInRangeToRender3d(x as double, y as double, z as double);
参数类型描述
xdoubleNo description provided
ydoubleNo description provided
zdoubleNo description provided

isInRangeToRenderDist

Checks if the entity is in range to render.

返回为布尔值

myMCPlayerEntity.isInRangeToRenderDist(distance as double);
参数类型描述
distancedoubleNo description provided

isInWater

Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning true)

返回为布尔值

myMCPlayerEntity.isInWater();

isInWaterOrBubbleColumn

返回为布尔值

myMCPlayerEntity.isInWaterOrBubbleColumn();

isInWaterRainOrBubbleColumn

返回为布尔值

myMCPlayerEntity.isInWaterRainOrBubbleColumn();

isInvisible

返回为布尔值

myMCPlayerEntity.isInvisible();

isInvisibleToPlayer

Only used by renderer in EntityLivingBase subclasses. Determines if an entity is visible or not to a specific player, if the entity is normally invisible. For EntityLivingBase subclasses, returning false when invisible will render the entity semi-transparent.

返回为布尔值

myMCPlayerEntity.isInvisibleToPlayer(player as crafttweaker.api.entity.player.MCPlayerEntity);
参数类型描述
playercrafttweaker.api.entity.player.MCPlayerEntityNo description provided

isInvulnerable

返回为布尔值

myMCPlayerEntity.isInvulnerable();

isLiving

返回为布尔值

myMCPlayerEntity.isLiving();

isNonBoss

Returns false if this Entity is a boss, true otherwise.

返回为布尔值

myMCPlayerEntity.isNonBoss();

isOffsetPositionInLiquid

Checks if the offset position from the entity's current position is inside of a liquid.

返回为布尔值

myMCPlayerEntity.isOffsetPositionInLiquid(x as double, y as double, z as double);
参数类型描述
xdoubleNo description provided
ydoubleNo description provided
zdoubleNo description provided

isOnLadder

Returns true if this entity should move as if it were on a ladder (either because it's actually on a ladder, or for AI reasons)

返回为布尔值

myMCPlayerEntity.isOnLadder();

isOnePlayerRiding

返回为布尔值

myMCPlayerEntity.isOnePlayerRiding();

isPassenger

返回为布尔值

myMCPlayerEntity.isPassenger();

isPlayerFullyAsleep

Returns whether or not the player is asleep and the screen has fully faded.

返回为布尔值

myMCPlayerEntity.isPlayerFullyAsleep();

isPotionActive

返回为布尔值

myMCPlayerEntity.isPotionActive(potionIn as crafttweaker.api.potion.MCPotionEffect);
参数类型描述
potionIncrafttweaker.api.potion.MCPotionEffectNo description provided

isPotionApplicable

返回为布尔值

myMCPlayerEntity.isPotionApplicable(potioneffectIn as crafttweaker.api.potion.MCPotionEffectInstance);
参数类型描述
potioneffectIncrafttweaker.api.potion.MCPotionEffectInstanceNo description provided

isPushedByWater

返回为布尔值

myMCPlayerEntity.isPushedByWater();

isServerWorld

Returns whether the entity is in a server world

返回为布尔值

myMCPlayerEntity.isServerWorld();

isSilent

Returns: True if this entity will not play sounds

返回为布尔值

myMCPlayerEntity.isSilent();

isSleeping

Returns whether player is sleeping or not

返回为布尔值

myMCPlayerEntity.isSleeping();

isSneaking

Returns if this entity is sneaking.

返回为布尔值

myMCPlayerEntity.isSneaking();

isSpawnForced

返回为布尔值

myMCPlayerEntity.isSpawnForced();

isSpectator

Returns true if the player is in spectator mode.

返回为布尔值

myMCPlayerEntity.isSpectator();

isSpinAttacking

返回为布尔值

myMCPlayerEntity.isSpinAttacking();

isSprinting

Get if the Entity is sprinting.

返回为布尔值

myMCPlayerEntity.isSprinting();

isSwimming

返回为布尔值

myMCPlayerEntity.isSwimming();

isUser

returns true if this is an EntityPlayerSP, or the logged in player.

返回为布尔值

myMCPlayerEntity.isUser();

isWet

Checks if this entity is either in water or on an open air block in rain (used in wolves).

返回为布尔值

myMCPlayerEntity.isWet();

jump

Causes this entity to do an upwards motion (jumping).

myMCPlayerEntity.jump();

livingTick

Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use this to react to sunlight and start to burn.

myMCPlayerEntity.livingTick();

moveToBlockPosAndAngles

myMCPlayerEntity.moveToBlockPosAndAngles(pos as crafttweaker.api.util.BlockPos, rotationYawIn as float, rotationPitchIn as float);
参数类型描述
crafttweaker.api.util.BlockPosNo description provided
rotationYawInfloatNo description provided
rotationPitchInfloatNo description provided

onAddedToWorld

myMCPlayerEntity.onAddedToWorld();

onCollideWithPlayer

Called by a player entity when they collide with an entity

myMCPlayerEntity.onCollideWithPlayer(entityIn as crafttweaker.api.entity.player.MCPlayerEntity);
参数类型描述
entityIncrafttweaker.api.entity.player.MCPlayerEntityNo description provided

onEnchant

myMCPlayerEntity.onEnchant(enchantedItem as crafttweaker.api.item.IItemStack, cost as int);
参数类型描述
enchantedItemcrafttweaker.api.item.IItemStackNo description provided
costintNo description provided

onEnterBubbleColumn

myMCPlayerEntity.onEnterBubbleColumn(downwards as boolean);
参数类型描述
downwardsbooleanNo description provided

onEnterBubbleColumnWithAirAbove

myMCPlayerEntity.onEnterBubbleColumnWithAirAbove(downwards as boolean);
参数类型描述
downwardsbooleanNo description provided

onKillCommand

Called by the /kill command.

myMCPlayerEntity.onKillCommand();

onRemovedFromWorld

myMCPlayerEntity.onRemovedFromWorld();

performHurtAnimation

Setups the entity to do the hurt animation. Only used by packets in multiplayer.

myMCPlayerEntity.performHurtAnimation();

preparePlayerToSpawn

Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned (only actually used on players though its also on Entity)

myMCPlayerEntity.preparePlayerToSpawn();

recalculateSize

myMCPlayerEntity.recalculateSize();

remove

myMCPlayerEntity.remove();
myMCPlayerEntity.remove(keepData as boolean);
参数类型描述
keepDatabooleanNo description provided

removeActivePotionEffect

Returns crafttweaker.api.potion.MCPotionEffectInstance

myMCPlayerEntity.removeActivePotionEffect(arg0 as crafttweaker.api.potion.MCPotionEffect);
参数类型描述
arg0crafttweaker.api.potion.MCPotionEffectNo description provided

removePassengers

Dismounts all entities riding this entity from this entity.

myMCPlayerEntity.removePassengers();

removePotionEffect

返回为布尔值

myMCPlayerEntity.removePotionEffect(effectIn as crafttweaker.api.potion.MCPotionEffect);
参数类型描述
effectIncrafttweaker.api.potion.MCPotionEffectNo description provided

removeTag

返回为布尔值

myMCPlayerEntity.removeTag(tag as String);
参数类型描述
tagStringNo description provided

replaceItemInInventory

返回为布尔值

myMCPlayerEntity.replaceItemInInventory(inventorySlot as int, itemStackIn as crafttweaker.api.item.IItemStack);
参数类型描述
inventorySlotintNo description provided
itemStackIncrafttweaker.api.item.IItemStackNo description provided

resetActiveHand

myMCPlayerEntity.resetActiveHand();

resetCooldown

myMCPlayerEntity.resetCooldown();

resetPositionToBB

Resets the entity's position to the center (planar) and bottom (vertical) points of its bounding box.

myMCPlayerEntity.resetPositionToBB();

respawnPlayer

myMCPlayerEntity.respawnPlayer();

revive

myMCPlayerEntity.revive();

rotateTowards

myMCPlayerEntity.rotateTowards(yaw as double, pitch as double);
参数类型描述
yawdoubleNo description provided
pitchdoubleNo description provided

sendEndCombat

Sends an END_COMBAT packet to the client

myMCPlayerEntity.sendEndCombat();

sendEnterCombat

Sends an ENTER_COMBAT packet to the client

myMCPlayerEntity.sendEnterCombat();

sendPlayerAbilities

Sends the player's abilities to the server (if there is one).

myMCPlayerEntity.sendPlayerAbilities();

setAIMoveSpeed

set the movespeed used for the new AI system

myMCPlayerEntity.setAIMoveSpeed(speedIn as float);
参数类型描述
speedInfloatNo description provided

setAbsorptionAmount

myMCPlayerEntity.setAbsorptionAmount(amount as float);
参数类型描述
amountfloatNo description provided

setAir

myMCPlayerEntity.setAir(air as int);
参数类型描述
airintNo description provided

setArrowCountInEntity

myMCPlayerEntity.setArrowCountInEntity(count as int);
参数类型描述
countintNo description provided

setBedPosition

myMCPlayerEntity.setBedPosition(p_213369_1_ as crafttweaker.api.util.BlockPos);
参数类型描述
p213369_1crafttweaker.api.util.BlockPosNo description provided

setCustomNameVisible

myMCPlayerEntity.setCustomNameVisible(alwaysRenderNameTag as boolean);
参数类型描述
alwaysRenderNameTagbooleanNo description provided

setEntityId

myMCPlayerEntity.setEntityId(id as int);
参数类型描述
idintNo description provided

setFire

Sets entity to burn for x amount of seconds, cannot lower amount of existing fire.

myMCPlayerEntity.setFire(seconds as int);
参数类型描述
secondsintNo description provided

setFireTimer

myMCPlayerEntity.setFireTimer(p_223308_1_ as int);
参数类型描述
p223308_1intNo description provided

setGlowing

myMCPlayerEntity.setGlowing(glowingIn as boolean);
参数类型描述
glowingInbooleanNo description provided

setHeadRotation

myMCPlayerEntity.setHeadRotation(yaw as float, pitch as int);
参数类型描述
yawfloatNo description provided
pitchintNo description provided

setHealth

myMCPlayerEntity.setHealth(health as float);
参数类型描述
healthfloatNo description provided

setIdleTime

myMCPlayerEntity.setIdleTime(idleTimeIn as int);
参数类型描述
idleTimeInintNo description provided

setInLava

myMCPlayerEntity.setInLava();

setInvisible

myMCPlayerEntity.setInvisible(invisible as boolean);
参数类型描述
invisiblebooleanNo description provided

setInvulnerable

Sets whether this Entity is invulnerable.

myMCPlayerEntity.setInvulnerable(isInvulnerable as boolean);
参数类型描述
isInvulnerablebooleanNo description provided

setJumping

myMCPlayerEntity.setJumping(jumping as boolean);
参数类型描述
jumpingbooleanNo description provided

setLocationAndAngles

Sets the location and Yaw/Pitch of an entity in the world

myMCPlayerEntity.setLocationAndAngles(x as double, y as double, z as double, yaw as float, pitch as float);
参数类型描述
xdoubleNo description provided
ydoubleNo description provided
zdoubleNo description provided
yawfloatNo description provided
pitchfloatNo description provided

setMotion

myMCPlayerEntity.setMotion(x as double, y as double, z as double);
参数类型描述
xdoubleNo description provided
ydoubleNo description provided
zdoubleNo description provided

setNoGravity

myMCPlayerEntity.setNoGravity(noGravity as boolean);
参数类型描述
noGravitybooleanNo description provided

setPartying

Called when a record starts or stops playing. Used to make parrots start or stop partying.

myMCPlayerEntity.setPartying(pos as crafttweaker.api.util.BlockPos, isPartying as boolean);
参数类型描述
crafttweaker.api.util.BlockPosNo description provided
isPartyingbooleanNo description provided

setPortal

Marks the entity as being inside a portal, activating teleportation logic in onEntityUpdate() in the following tick(s).

myMCPlayerEntity.setPortal(pos as crafttweaker.api.util.BlockPos);
参数类型描述
crafttweaker.api.util.BlockPosNo description provided

setPosition

Sets the x,y,z of the entity from the given parameters. Also seems to set up a bounding box.

myMCPlayerEntity.setPosition(x as double, y as double, z as double);
参数类型描述
xdoubleNo description provided
ydoubleNo description provided
zdoubleNo description provided

setPositionAndRotation

Sets position and rotation, clamping and wrapping params to valid values. Used by network code.

myMCPlayerEntity.setPositionAndRotation(x as double, y as double, z as double, yaw as float, pitch as float);
参数类型描述
xdoubleNo description provided
ydoubleNo description provided
zdoubleNo description provided
yawfloatNo description provided
pitchfloatNo description provided

setPositionAndRotationDirect

Sets a target for the client to interpolate towards over the next few ticks

myMCPlayerEntity.setPositionAndRotationDirect(x as double, y as double, z as double, yaw as float, pitch as float, posRotationIncrements as int, teleport as boolean);
参数类型描述
xdoubleNo description provided
ydoubleNo description provided
zdoubleNo description provided
yawfloatNo description provided
pitchfloatNo description provided
posRotationIncrementsintNo description provided
teleportbooleanNo description provided

setPositionAndUpdate

Sets the position of the entity and updates the 'last' variables

myMCPlayerEntity.setPositionAndUpdate(x as double, y as double, z as double);
参数类型描述
xdoubleNo description provided
ydoubleNo description provided
zdoubleNo description provided

setPositionNonDirty

返回为布尔值

myMCPlayerEntity.setPositionNonDirty();

setReducedDebug

myMCPlayerEntity.setReducedDebug(reducedDebug as boolean);
参数类型描述
reducedDebugbooleanNo description provided

setRenderYawOffset

Set the render yaw offset

myMCPlayerEntity.setRenderYawOffset(offset as float);
参数类型描述
offsetfloatNo description provided

setRotationYawHead

Sets the head's yaw rotation of the entity.

myMCPlayerEntity.setRotationYawHead(rotation as float);
参数类型描述
rotationfloatNo description provided

setScore

Set player's score

myMCPlayerEntity.setScore(scoreIn as int);
参数类型描述
scoreInintNo description provided

setSilent

When set to true the entity will not play sounds.

myMCPlayerEntity.setSilent(isSilent as boolean);
参数类型描述
isSilentbooleanNo description provided

setSneaking

Sets the sneaking flag.

myMCPlayerEntity.setSneaking(sneaking as boolean);
参数类型描述
sneakingbooleanNo description provided

setSpawnPoint

myMCPlayerEntity.setSpawnPoint(pos as crafttweaker.api.util.BlockPos, forced as boolean);
参数类型描述
crafttweaker.api.util.BlockPosNo description provided
forcedbooleanNo description provided

setSprinting

Set sprinting switch for Entity.

myMCPlayerEntity.setSprinting(sprinting as boolean);
参数类型描述
sprintingbooleanNo description provided

setSwimming

myMCPlayerEntity.setSwimming(p_204711_1_ as boolean);
参数类型描述
p204711_1booleanNo description provided

setVelocity

Updates the entity motion clientside, called by packets from the server

myMCPlayerEntity.setVelocity(x as double, y as double, z as double);
参数类型描述
xdoubleNo description provided
ydoubleNo description provided
zdoubleNo description provided

shouldHeal

Checks if the player's health is not full and not zero.

返回为布尔值

myMCPlayerEntity.shouldHeal();

shouldReceiveErrors

返回为布尔值

myMCPlayerEntity.shouldReceiveErrors();

shouldReceiveFeedback

返回为布尔值

myMCPlayerEntity.shouldReceiveFeedback();

shouldRenderSneaking

返回为布尔值

myMCPlayerEntity.shouldRenderSneaking();

shouldRiderFaceForward

Returns true if the entity's rider (EntityPlayer) should face forward when mounted. currently only used in vanilla code by pigs.

返回为布尔值

myMCPlayerEntity.shouldRiderFaceForward(player as crafttweaker.api.entity.player.MCPlayerEntity);
参数类型描述
playercrafttweaker.api.entity.player.MCPlayerEntityThe player who is riding the entity.

shouldRiderSit

返回为布尔值

myMCPlayerEntity.shouldRiderSit();

spawnRunningParticles

Attempts to create sprinting particles if the entity is sprinting and not in water.

myMCPlayerEntity.spawnRunningParticles();

spawnSweepParticles

myMCPlayerEntity.spawnSweepParticles();

startSleeping

myMCPlayerEntity.startSleeping(p_213342_1_ as crafttweaker.api.util.BlockPos);
参数类型描述
p213342_1crafttweaker.api.util.BlockPosNo description provided

startSpinAttack

myMCPlayerEntity.startSpinAttack(p_204803_1_ as int);
参数类型描述
p204803_1intNo description provided

stopActiveHand

myMCPlayerEntity.stopActiveHand();

stopRiding

Dismounts this entity from the entity it is riding.

myMCPlayerEntity.stopRiding();

teleportKeepLoaded

myMCPlayerEntity.teleportKeepLoaded(p_223102_1_ as double, p_223102_3_ as double, p_223102_5_ as double);
参数类型描述
p223102_1doubleNo description provided
p223102_3doubleNo description provided
p223102_5doubleNo description provided

tick

Called to update the entity's position/logic.

myMCPlayerEntity.tick();

toString

返回字符串[String]

myMCPlayerEntity.toString();

updateRidden

Handles updating while riding another entity

myMCPlayerEntity.updateRidden();

updateSwimming

myMCPlayerEntity.updateSwimming();

wakeUp

myMCPlayerEntity.wakeUp();

wakeUpPlayer

Wake up the player if they're sleeping.

myMCPlayerEntity.wakeUpPlayer(immediately as boolean, updateWorldFlag as boolean, setSpawn as boolean);
参数类型描述
immediatelybooleanNo description provided
updateWorldFlagbooleanNo description provided
setSpawnbooleanNo description provided

xpBarCap

This method returns the cap amount of experience that the experience bar can hold. With each level, the experience cap on the player's experience bar is raised by 10.

返回为int值

myMCPlayerEntity.xpBarCap();