Home Getting Started With Scripts Commands Examples

MCPlayerEntity

This class was added by a mod with mod-id crafttweaker. So you need to have this mod installed if you want to use this feature.

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import.

script.zs
crafttweaker.api.entity.player.MCPlayerEntity

Methods

addExhaustion

increases exhaustion level by supplied amount

script.zs
myMCPlayerEntity.addExhaustion(exhaustion as float);
ParameterTypeDescription
Parameter
exhaustion
Type
float
Description
No description provided

addExperienceLevel

Add experience levels to this player.

script.zs
myMCPlayerEntity.addExperienceLevel(levels as int);
ParameterTypeDescription
Parameter
levels
Type
int
Description
No description provided

addItemStackToInventory

Returns boolean

script.zs
myMCPlayerEntity.addItemStackToInventory(p_191521_1_ as crafttweaker.api.item.IItemStack);
ParameterTypeDescription
Parameter
p_191521_1_
Type
crafttweaker.api.item.IItemStack
Description
No description provided

addMovementStat

Adds a value to a movement statistic field - like run, walk, swin or climb.

script.zs
myMCPlayerEntity.addMovementStat(p_71000_1_ as double, p_71000_3_ as double, p_71000_5_ as double);
ParameterTypeDescription
Parameter
p_71000_1_
Type
double
Description
No description provided
Parameter
p_71000_3_
Type
double
Description
No description provided
Parameter
p_71000_5_
Type
double
Description
No description provided

addPotionEffect

Returns boolean

script.zs
myMCPlayerEntity.addPotionEffect(effectInstanceIn as crafttweaker.api.potion.MCPotionEffectInstance);
ParameterTypeDescription
Parameter
effectInstanceIn
Type
crafttweaker.api.potion.MCPotionEffectInstance
Description
No description provided

addScore

Add to player’s score

script.zs
myMCPlayerEntity.addScore(scoreIn as int);
ParameterTypeDescription
Parameter
scoreIn
Type
int
Description
No description provided

addTag

Returns boolean

script.zs
myMCPlayerEntity.addTag(tag as String);
ParameterTypeDescription
Parameter
tag
Type
String
Description
No description provided

addVelocity

Adds to the current velocity of the entity, and sets to true.

script.zs
myMCPlayerEntity.addVelocity(x as double, y as double, z as double);
ParameterTypeDescription
Parameter
x
Type
double
Description
No description provided
Parameter
y
Type
double
Description
No description provided
Parameter
z
Type
double
Description
No description provided

allowLogging

Returns boolean

script.zs
myMCPlayerEntity.allowLogging();

attackable

Returns boolean

script.zs
myMCPlayerEntity.attackable();

attemptTeleport

Returns boolean

script.zs
myMCPlayerEntity.attemptTeleport(p_213373_1_ as double, p_213373_3_ as double, p_213373_5_ as double, p_213373_7_ as boolean);
ParameterTypeDescription
Parameter
p_213373_1_
Type
double
Description
No description provided
Parameter
p_213373_3_
Type
double
Description
No description provided
Parameter
p_213373_5_
Type
double
Description
No description provided
Parameter
p_213373_7_
Type
boolean
Description
No description provided

baseTick

Gets called every tick from main Entity class

script.zs
myMCPlayerEntity.baseTick();

canAttackPlayer

Returns boolean

script.zs
myMCPlayerEntity.canAttackPlayer(other as crafttweaker.api.entity.player.MCPlayerEntity);
ParameterTypeDescription
Parameter
other
Type
crafttweaker.api.entity.player.MCPlayerEntity
Description
No description provided

canBeAttackedWithItem

Returns true if it’s possible to attack this entity with an item.

Returns boolean

script.zs
myMCPlayerEntity.canBeAttackedWithItem();

canBeCollidedWith

Returns true if other Entities should be prevented from moving through this Entity.

Returns boolean

script.zs
myMCPlayerEntity.canBeCollidedWith();

canBeHitWithPotion

Returns false if the entity is an armor stand. Returns true for all other entity living bases.

Returns boolean

script.zs
myMCPlayerEntity.canBeHitWithPotion();

canBePushed

Returns true if this entity should push and be pushed by other entities when colliding.

Returns boolean

script.zs
myMCPlayerEntity.canBePushed();

canBeRiddenInWater

Returns boolean

script.zs
myMCPlayerEntity.canBeRiddenInWater();

canBreatheUnderwater

Returns boolean

script.zs
myMCPlayerEntity.canBreatheUnderwater();

canEat

Returns boolean

script.zs
myMCPlayerEntity.canEat(ignoreHunger as boolean);
ParameterTypeDescription
Parameter
ignoreHunger
Type
boolean
Description
No description provided

canHarvestBlock

Returns boolean

script.zs
myMCPlayerEntity.canHarvestBlock(state as crafttweaker.api.block.MCBlockState);
ParameterTypeDescription
Parameter
state
Type
crafttweaker.api.block.MCBlockState
Description
No description provided

canPassengerSteer

Returns boolean

script.zs
myMCPlayerEntity.canPassengerSteer();

canPlayerEdit

Returns whether this player can modify the block at a certain location with the given stack.

The position being queried is {@code pos.offset(facing.getOpposite()))}. Returns: `Whether this player may modify the queried location in the current world` @see ItemStack#canPlaceOn(Block) @see ItemStack#canEditBlocks() @see PlayerCapabilities#allowEdit

Returns boolean

script.zs
myMCPlayerEntity.canPlayerEdit(pos as crafttweaker.api.util.BlockPos, facing as crafttweaker.api.util.Direction, stack as crafttweaker.api.item.IItemStack);
ParameterTypeDescription
Parameter
pos
Type
crafttweaker.api.util.BlockPos
Description
No description provided
Parameter
facing
Type
crafttweaker.api.util.Direction
Description
No description provided
Parameter
stack
Type
crafttweaker.api.item.IItemStack
Description
No description provided

canRenderOnFire

Return whether this entity should be rendered as on fire.

Returns boolean

script.zs
myMCPlayerEntity.canRenderOnFire();

canRiderInteract

Returns boolean

script.zs
myMCPlayerEntity.canRiderInteract();

canSwim

Returns boolean

script.zs
myMCPlayerEntity.canSwim();

canTrample

Returns boolean

script.zs
myMCPlayerEntity.canTrample(state as crafttweaker.api.block.MCBlockState, pos as crafttweaker.api.util.BlockPos, fallDistance as float);
ParameterTypeDescription
Parameter
state
Type
crafttweaker.api.block.MCBlockState
Description
No description provided
Parameter
pos
Type
crafttweaker.api.util.BlockPos
Description
No description provided
Parameter
fallDistance
Type
float
Description
No description provided

canUpdate

Returns boolean

script.zs
myMCPlayerEntity.canUpdate();
script.zs
myMCPlayerEntity.canUpdate(value as boolean);
ParameterTypeDescription
Parameter
value
Type
boolean
Description
No description provided

canUseCommandBlock

Returns boolean

script.zs
myMCPlayerEntity.canUseCommandBlock();

clearActivePotions

Returns boolean

script.zs
myMCPlayerEntity.clearActivePotions();

clearBedPosition

script.zs
myMCPlayerEntity.clearBedPosition();

closeScreen

set current crafting inventory back to the 2x2 square

script.zs
myMCPlayerEntity.closeScreen();

curePotionEffects

Returns boolean

script.zs
myMCPlayerEntity.curePotionEffects(curativeItem as crafttweaker.api.item.IItemStack);
ParameterTypeDescription
Parameter
curativeItem
Type
crafttweaker.api.item.IItemStack
Description
No description provided

detach

script.zs
myMCPlayerEntity.detach();

disableShield

script.zs
myMCPlayerEntity.disableShield(p_190777_1_ as boolean);
ParameterTypeDescription
Parameter
p_190777_1_
Type
boolean
Description
No description provided

doesEntityNotTriggerPressurePlate

Return whether this entity should NOT trigger a pressure plate or a tripwire.

Returns boolean

script.zs
myMCPlayerEntity.doesEntityNotTriggerPressurePlate();

equals

Returns boolean

script.zs
myMCPlayerEntity.equals(p_equals_1_ as Object);
ParameterTypeDescription
Parameter
p_equals_1_
Type
Object
Description
No description provided

extinguish

Removes fire from entity.

script.zs
myMCPlayerEntity.extinguish();

fall

script.zs
myMCPlayerEntity.fall(distance as float, damageMultiplier as float);
ParameterTypeDescription
Parameter
distance
Type
float
Description
No description provided
Parameter
damageMultiplier
Type
float
Description
No description provided

findAmmo

Returns crafttweaker.api.item.IItemStack

script.zs
myMCPlayerEntity.findAmmo(shootable as crafttweaker.api.item.IItemStack);
ParameterTypeDescription
Parameter
shootable
Type
crafttweaker.api.item.IItemStack
Description
No description provided

func_213300_bk

Returns boolean

script.zs
myMCPlayerEntity.func_213300_bk();

func_213312_b

script.zs
myMCPlayerEntity.func_213312_b(p_213312_1_ as double, p_213312_3_ as double, p_213312_5_ as double);
ParameterTypeDescription
Parameter
p_213312_1_
Type
double
Description
No description provided
Parameter
p_213312_3_
Type
double
Description
No description provided
Parameter
p_213312_5_
Type
double
Description
No description provided

func_213314_bj

Returns boolean

script.zs
myMCPlayerEntity.func_213314_bj();

func_213343_cS

Returns float

script.zs
myMCPlayerEntity.func_213343_cS();

func_213365_e

Returns boolean

script.zs
myMCPlayerEntity.func_213365_e(itemstackIn as crafttweaker.api.item.IItemStack);
ParameterTypeDescription
Parameter
itemstackIn
Type
crafttweaker.api.item.IItemStack
Description
No description provided

getAIMoveSpeed

the movespeed used for the new AI system

Returns float

script.zs
myMCPlayerEntity.getAIMoveSpeed();

getAbsorptionAmount

Returns the amount of health added by the Absorption effect.

Returns float

script.zs
myMCPlayerEntity.getAbsorptionAmount();

getActiveItemStack

Returns crafttweaker.api.item.IItemStack

script.zs
myMCPlayerEntity.getActiveItemStack();

getActivePotionEffect

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

Returns crafttweaker.api.potion.MCPotionEffectInstance

script.zs
myMCPlayerEntity.getActivePotionEffect(potionIn as crafttweaker.api.potion.MCPotionEffect);
ParameterTypeDescription
Parameter
potionIn
Type
crafttweaker.api.potion.MCPotionEffect
Description
No description provided

getActivePotionEffects

Returns Collection<crafttweaker.api.potion.MCPotionEffectInstance>

script.zs
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

script.zs
myMCPlayerEntity.getAdjustedHorizontalFacing();

getAir

Returns int

script.zs
myMCPlayerEntity.getAir();

getAlwaysRenderNameTagForRender

Returns boolean

script.zs
myMCPlayerEntity.getAlwaysRenderNameTagForRender();

getArrowCountInEntity

Returns int

script.zs
myMCPlayerEntity.getArrowCountInEntity();

getBedDirection

gets the Direction for the camera if this entity is sleeping

Returns crafttweaker.api.util.Direction

script.zs
myMCPlayerEntity.getBedDirection();

getBedLocation

Returns crafttweaker.api.util.BlockPos

script.zs
myMCPlayerEntity.getBedLocation();

getBlockState

Returns crafttweaker.api.block.MCBlockState

script.zs
myMCPlayerEntity.getBlockState();

getBrightness

Gets how bright this entity is.

Returns float

script.zs
myMCPlayerEntity.getBrightness();

getBrightnessForRender

Returns int

script.zs
myMCPlayerEntity.getBrightnessForRender();

getCachedUniqueIdString

Returns String

script.zs
myMCPlayerEntity.getCachedUniqueIdString();

getClassification

Returns crafttweaker.api.entity.MCEntityClassification

script.zs
myMCPlayerEntity.getClassification(forSpawnCount as boolean);
ParameterTypeDescription
Parameter
forSpawnCount
Type
boolean
Description
No description provided

getCollisionBorderSize

Returns float

script.zs
myMCPlayerEntity.getCollisionBorderSize();

getCooldownPeriod

Returns float

script.zs
myMCPlayerEntity.getCooldownPeriod();

getCooledAttackStrength

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

Returns float

script.zs
myMCPlayerEntity.getCooledAttackStrength(adjustTicks as float);
ParameterTypeDescription
Parameter
adjustTicks
Type
float
Description
No description provided

getDigSpeed

Returns float

script.zs
myMCPlayerEntity.getDigSpeed(state as crafttweaker.api.block.MCBlockState);
ParameterTypeDescription
Parameter
state
Type
crafttweaker.api.block.MCBlockState
Description
No description provided

Returns float

script.zs
myMCPlayerEntity.getDigSpeed(arg0 as crafttweaker.api.block.MCBlockState, arg1 as crafttweaker.api.util.BlockPos);
ParameterTypeDescription
Parameter
arg0
Type
crafttweaker.api.block.MCBlockState
Description
No description provided
Parameter
arg1
Type
crafttweaker.api.util.BlockPos
Description
No description provided

getDistanceSq

Returns double

script.zs
myMCPlayerEntity.getDistanceSq(x as double, y as double, z as double);
ParameterTypeDescription
Parameter
x
Type
double
Description
No description provided
Parameter
y
Type
double
Description
No description provided
Parameter
z
Type
double
Description
No description provided

getEntityId

Returns int

script.zs
myMCPlayerEntity.getEntityId();

getEntityString

Returns String

script.zs
myMCPlayerEntity.getEntityString();

getEyeHeight

Returns float

script.zs
myMCPlayerEntity.getEyeHeight();

getFireTimer

Returns int

script.zs
myMCPlayerEntity.getFireTimer();

getHealth

Returns float

script.zs
myMCPlayerEntity.getHealth();

getHeight

Returns float

script.zs
myMCPlayerEntity.getHeight();

getHeldItemMainhand

Returns crafttweaker.api.item.IItemStack

script.zs
myMCPlayerEntity.getHeldItemMainhand();

getHeldItemOffhand

Returns crafttweaker.api.item.IItemStack

script.zs
myMCPlayerEntity.getHeldItemOffhand();

getHorizontalFacing

Gets the horizontal facing direction of this Entity.

Returns crafttweaker.api.util.Direction

script.zs
myMCPlayerEntity.getHorizontalFacing();

getIdleTime

Returns int

script.zs
myMCPlayerEntity.getIdleTime();

getItemInUseCount

Returns int

script.zs
myMCPlayerEntity.getItemInUseCount();

getItemInUseMaxCount

Returns int

script.zs
myMCPlayerEntity.getItemInUseMaxCount();

getLastAttackedEntityTime

Returns int

script.zs
myMCPlayerEntity.getLastAttackedEntityTime();

getLuck

Returns float

script.zs
myMCPlayerEntity.getLuck();

getMaxAir

Returns int

script.zs
myMCPlayerEntity.getMaxAir();

getMaxFallHeight

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

Returns int

script.zs
myMCPlayerEntity.getMaxFallHeight();

getMaxHealth

Returns float

script.zs
myMCPlayerEntity.getMaxHealth();

getMaxInPortalTime

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

Returns int

script.zs
myMCPlayerEntity.getMaxInPortalTime();

getMountedYOffset

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

Returns double

script.zs
myMCPlayerEntity.getMountedYOffset();

getPitch

Gets the current pitch of the entity.

Returns float

script.zs
myMCPlayerEntity.getPitch(partialTicks as float);
ParameterTypeDescription
Parameter
partialTicks
Type
float
Description
No description provided

getPortalCooldown

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

Returns int

script.zs
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

script.zs
myMCPlayerEntity.getPosition();

getRenderScale

Returns float

script.zs
myMCPlayerEntity.getRenderScale();

getRevengeTimer

Returns int

script.zs
myMCPlayerEntity.getRevengeTimer();

getRotationYawHead

Returns float

script.zs
myMCPlayerEntity.getRotationYawHead();

getScore

Returns int

script.zs
myMCPlayerEntity.getScore();

getScoreboardName

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

Returns String

script.zs
myMCPlayerEntity.getScoreboardName();

getSleepTimer

Returns int

script.zs
myMCPlayerEntity.getSleepTimer();

getSubmergedHeight

Returns double

script.zs
myMCPlayerEntity.getSubmergedHeight();

getSwimAnimation

Returns float

script.zs
myMCPlayerEntity.getSwimAnimation(partialTicks as float);
ParameterTypeDescription
Parameter
partialTicks
Type
float
Description
No description provided

getSwingProgress

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

Returns float

script.zs
myMCPlayerEntity.getSwingProgress(partialTickTime as float);
ParameterTypeDescription
Parameter
partialTickTime
Type
float
Description
No description provided

getTags

Returns Set

script.zs
myMCPlayerEntity.getTags();

getTeleportDirection

Returns crafttweaker.api.util.Direction

script.zs
myMCPlayerEntity.getTeleportDirection();

getTicksElytraFlying

Returns int

script.zs
myMCPlayerEntity.getTicksElytraFlying();

getTotalArmorValue

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

Returns int

script.zs
myMCPlayerEntity.getTotalArmorValue();

getWidth

Returns float

script.zs
myMCPlayerEntity.getWidth();

getXPSeed

Returns int

script.zs
myMCPlayerEntity.getXPSeed();

getYOffset

Returns the Y Offset of this entity.

Returns double

script.zs
myMCPlayerEntity.getYOffset();

getYaw

Gets the current yaw of the entity

Returns float

script.zs
myMCPlayerEntity.getYaw(partialTicks as float);
ParameterTypeDescription
Parameter
partialTicks
Type
float
Description
No description provided

giveExperiencePoints

script.zs
myMCPlayerEntity.giveExperiencePoints(p_195068_1_ as int);
ParameterTypeDescription
Parameter
p_195068_1_
Type
int
Description
No description provided

handleStatusUpdate

script.zs
myMCPlayerEntity.handleStatusUpdate(id as byte);
ParameterTypeDescription
Parameter
id
Type
byte
Description
No description provided

handleWaterMovement

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

Returns boolean

script.zs
myMCPlayerEntity.handleWaterMovement();

hasCustomName

Returns boolean

script.zs
myMCPlayerEntity.hasCustomName();

hasNoGravity

Returns boolean

script.zs
myMCPlayerEntity.hasNoGravity();

hasPermissionLevel

Returns boolean

script.zs
myMCPlayerEntity.hasPermissionLevel(p_211513_1_ as int);
ParameterTypeDescription
Parameter
p_211513_1_
Type
int
Description
No description provided

hasReducedDebug

Whether the “reducedDebugInfo” option is active for this player.

Returns boolean

script.zs
myMCPlayerEntity.hasReducedDebug();

hashCode

Returns int

script.zs
myMCPlayerEntity.hashCode();

heal

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

script.zs
myMCPlayerEntity.heal(healAmount as float);
ParameterTypeDescription
Parameter
healAmount
Type
float
Description
No 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

Returns boolean

script.zs
myMCPlayerEntity.ignoreItemEntityData();

isActiveItemStackBlocking

Returns boolean

script.zs
myMCPlayerEntity.isActiveItemStackBlocking();

isAddedToWorld

Returns boolean

script.zs
myMCPlayerEntity.isAddedToWorld();

isAlive

Returns true if the entity has not been .

Returns boolean

script.zs
myMCPlayerEntity.isAlive();

isAllowEdit

Returns boolean

script.zs
myMCPlayerEntity.isAllowEdit();

isBeingRidden

If at least 1 entity is riding this one

Returns boolean

script.zs
myMCPlayerEntity.isBeingRidden();

isBurning

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

Returns boolean

script.zs
myMCPlayerEntity.isBurning();

isChild

If Animal, checks if the age timer is negative

Returns boolean

script.zs
myMCPlayerEntity.isChild();

isCreative

Returns boolean

script.zs
myMCPlayerEntity.isCreative();

isCustomNameVisible

Returns boolean

script.zs
myMCPlayerEntity.isCustomNameVisible();

isElytraFlying

Returns boolean

script.zs
myMCPlayerEntity.isElytraFlying();

isEntityInsideOpaqueBlock

Checks if this entity is inside of an opaque block

Returns boolean

script.zs
myMCPlayerEntity.isEntityInsideOpaqueBlock();

isEntityUndead

Returns true if this entity is undead.

Returns boolean

script.zs
myMCPlayerEntity.isEntityUndead();

isGlowing

Returns boolean

script.zs
myMCPlayerEntity.isGlowing();

isHandActive

Returns boolean

script.zs
myMCPlayerEntity.isHandActive();

isImmuneToExplosions

Returns boolean

script.zs
myMCPlayerEntity.isImmuneToExplosions();

isImmuneToFire

Returns boolean

script.zs
myMCPlayerEntity.isImmuneToFire();

isInLava

Returns boolean

script.zs
myMCPlayerEntity.isInLava();

isInRangeToRender3d

Returns boolean

script.zs
myMCPlayerEntity.isInRangeToRender3d(x as double, y as double, z as double);
ParameterTypeDescription
Parameter
x
Type
double
Description
No description provided
Parameter
y
Type
double
Description
No description provided
Parameter
z
Type
double
Description
No description provided

isInRangeToRenderDist

Checks if the entity is in range to render.

Returns boolean

script.zs
myMCPlayerEntity.isInRangeToRenderDist(distance as double);
ParameterTypeDescription
Parameter
distance
Type
double
Description
No description provided

isInWater

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

Returns boolean

script.zs
myMCPlayerEntity.isInWater();

isInWaterOrBubbleColumn

Returns boolean

script.zs
myMCPlayerEntity.isInWaterOrBubbleColumn();

isInWaterRainOrBubbleColumn

Returns boolean

script.zs
myMCPlayerEntity.isInWaterRainOrBubbleColumn();

isInvisible

Returns boolean

script.zs
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.

Returns boolean

script.zs
myMCPlayerEntity.isInvisibleToPlayer(player as crafttweaker.api.entity.player.MCPlayerEntity);
ParameterTypeDescription
Parameter
player
Type
crafttweaker.api.entity.player.MCPlayerEntity
Description
No description provided

isInvulnerable

Returns boolean

script.zs
myMCPlayerEntity.isInvulnerable();

isLiving

Returns boolean

script.zs
myMCPlayerEntity.isLiving();

isNonBoss

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

Returns boolean

script.zs
myMCPlayerEntity.isNonBoss();

isOffsetPositionInLiquid

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

Returns boolean

script.zs
myMCPlayerEntity.isOffsetPositionInLiquid(x as double, y as double, z as double);
ParameterTypeDescription
Parameter
x
Type
double
Description
No description provided
Parameter
y
Type
double
Description
No description provided
Parameter
z
Type
double
Description
No 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)

Returns boolean

script.zs
myMCPlayerEntity.isOnLadder();

isOnePlayerRiding

Returns boolean

script.zs
myMCPlayerEntity.isOnePlayerRiding();

isPassenger

Returns boolean

script.zs
myMCPlayerEntity.isPassenger();

isPlayerFullyAsleep

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

Returns boolean

script.zs
myMCPlayerEntity.isPlayerFullyAsleep();

isPotionActive

Returns boolean

script.zs
myMCPlayerEntity.isPotionActive(potionIn as crafttweaker.api.potion.MCPotionEffect);
ParameterTypeDescription
Parameter
potionIn
Type
crafttweaker.api.potion.MCPotionEffect
Description
No description provided

isPotionApplicable

Returns boolean

script.zs
myMCPlayerEntity.isPotionApplicable(potioneffectIn as crafttweaker.api.potion.MCPotionEffectInstance);
ParameterTypeDescription
Parameter
potioneffectIn
Type
crafttweaker.api.potion.MCPotionEffectInstance
Description
No description provided

isPushedByWater

Returns boolean

script.zs
myMCPlayerEntity.isPushedByWater();

isServerWorld

Returns whether the entity is in a server world

Returns boolean

script.zs
myMCPlayerEntity.isServerWorld();

isSilent

Returns: True if this entity will not play sounds

Returns boolean

script.zs
myMCPlayerEntity.isSilent();

isSleeping

Returns whether player is sleeping or not

Returns boolean

script.zs
myMCPlayerEntity.isSleeping();

isSneaking

Returns if this entity is sneaking.

Returns boolean

script.zs
myMCPlayerEntity.isSneaking();

isSpawnForced

Returns boolean

script.zs
myMCPlayerEntity.isSpawnForced();

isSpectator

Returns true if the player is in spectator mode.

Returns boolean

script.zs
myMCPlayerEntity.isSpectator();

isSpinAttacking

Returns boolean

script.zs
myMCPlayerEntity.isSpinAttacking();

isSprinting

Get if the Entity is sprinting.

Returns boolean

script.zs
myMCPlayerEntity.isSprinting();

isSwimming

Returns boolean

script.zs
myMCPlayerEntity.isSwimming();

isUser

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

Returns boolean

script.zs
myMCPlayerEntity.isUser();

isWet

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

Returns boolean

script.zs
myMCPlayerEntity.isWet();

jump

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

script.zs
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.

script.zs
myMCPlayerEntity.livingTick();

moveToBlockPosAndAngles

script.zs
myMCPlayerEntity.moveToBlockPosAndAngles(pos as crafttweaker.api.util.BlockPos, rotationYawIn as float, rotationPitchIn as float);
ParameterTypeDescription
Parameter
pos
Type
crafttweaker.api.util.BlockPos
Description
No description provided
Parameter
rotationYawIn
Type
float
Description
No description provided
Parameter
rotationPitchIn
Type
float
Description
No description provided

onAddedToWorld

script.zs
myMCPlayerEntity.onAddedToWorld();

onCollideWithPlayer

Called by a player entity when they collide with an entity

script.zs
myMCPlayerEntity.onCollideWithPlayer(entityIn as crafttweaker.api.entity.player.MCPlayerEntity);
ParameterTypeDescription
Parameter
entityIn
Type
crafttweaker.api.entity.player.MCPlayerEntity
Description
No description provided

onEnchant

script.zs
myMCPlayerEntity.onEnchant(enchantedItem as crafttweaker.api.item.IItemStack, cost as int);
ParameterTypeDescription
Parameter
enchantedItem
Type
crafttweaker.api.item.IItemStack
Description
No description provided
Parameter
cost
Type
int
Description
No description provided

onEnterBubbleColumn

script.zs
myMCPlayerEntity.onEnterBubbleColumn(downwards as boolean);
ParameterTypeDescription
Parameter
downwards
Type
boolean
Description
No description provided

onEnterBubbleColumnWithAirAbove

script.zs
myMCPlayerEntity.onEnterBubbleColumnWithAirAbove(downwards as boolean);
ParameterTypeDescription
Parameter
downwards
Type
boolean
Description
No description provided

onKillCommand

Called by the /kill command.

script.zs
myMCPlayerEntity.onKillCommand();

onRemovedFromWorld

script.zs
myMCPlayerEntity.onRemovedFromWorld();

performHurtAnimation

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

script.zs
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)

script.zs
myMCPlayerEntity.preparePlayerToSpawn();

recalculateSize

script.zs
myMCPlayerEntity.recalculateSize();

remove

script.zs
myMCPlayerEntity.remove();
script.zs
myMCPlayerEntity.remove(keepData as boolean);
ParameterTypeDescription
Parameter
keepData
Type
boolean
Description
No description provided

removeActivePotionEffect

Returns crafttweaker.api.potion.MCPotionEffectInstance

script.zs
myMCPlayerEntity.removeActivePotionEffect(arg0 as crafttweaker.api.potion.MCPotionEffect);
ParameterTypeDescription
Parameter
arg0
Type
crafttweaker.api.potion.MCPotionEffect
Description
No description provided

removePassengers

Dismounts all entities riding this entity from this entity.

script.zs
myMCPlayerEntity.removePassengers();

removePotionEffect

Returns boolean

script.zs
myMCPlayerEntity.removePotionEffect(effectIn as crafttweaker.api.potion.MCPotionEffect);
ParameterTypeDescription
Parameter
effectIn
Type
crafttweaker.api.potion.MCPotionEffect
Description
No description provided

removeTag

Returns boolean

script.zs
myMCPlayerEntity.removeTag(tag as String);
ParameterTypeDescription
Parameter
tag
Type
String
Description
No description provided

replaceItemInInventory

Returns boolean

script.zs
myMCPlayerEntity.replaceItemInInventory(inventorySlot as int, itemStackIn as crafttweaker.api.item.IItemStack);
ParameterTypeDescription
Parameter
inventorySlot
Type
int
Description
No description provided
Parameter
itemStackIn
Type
crafttweaker.api.item.IItemStack
Description
No description provided

resetActiveHand

script.zs
myMCPlayerEntity.resetActiveHand();

resetCooldown

script.zs
myMCPlayerEntity.resetCooldown();

resetPositionToBB

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

script.zs
myMCPlayerEntity.resetPositionToBB();

respawnPlayer

script.zs
myMCPlayerEntity.respawnPlayer();

revive

script.zs
myMCPlayerEntity.revive();

rotateTowards

script.zs
myMCPlayerEntity.rotateTowards(yaw as double, pitch as double);
ParameterTypeDescription
Parameter
yaw
Type
double
Description
No description provided
Parameter
pitch
Type
double
Description
No description provided

sendEndCombat

Sends an END_COMBAT packet to the client

script.zs
myMCPlayerEntity.sendEndCombat();

sendEnterCombat

Sends an ENTER_COMBAT packet to the client

script.zs
myMCPlayerEntity.sendEnterCombat();

sendPlayerAbilities

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

script.zs
myMCPlayerEntity.sendPlayerAbilities();

setAIMoveSpeed

set the movespeed used for the new AI system

script.zs
myMCPlayerEntity.setAIMoveSpeed(speedIn as float);
ParameterTypeDescription
Parameter
speedIn
Type
float
Description
No description provided

setAbsorptionAmount

script.zs
myMCPlayerEntity.setAbsorptionAmount(amount as float);
ParameterTypeDescription
Parameter
amount
Type
float
Description
No description provided

setAir

script.zs
myMCPlayerEntity.setAir(air as int);
ParameterTypeDescription
Parameter
air
Type
int
Description
No description provided

setArrowCountInEntity

script.zs
myMCPlayerEntity.setArrowCountInEntity(count as int);
ParameterTypeDescription
Parameter
count
Type
int
Description
No description provided

setBedPosition

script.zs
myMCPlayerEntity.setBedPosition(p_213369_1_ as crafttweaker.api.util.BlockPos);
ParameterTypeDescription
Parameter
p_213369_1_
Type
crafttweaker.api.util.BlockPos
Description
No description provided

setCustomNameVisible

script.zs
myMCPlayerEntity.setCustomNameVisible(alwaysRenderNameTag as boolean);
ParameterTypeDescription
Parameter
alwaysRenderNameTag
Type
boolean
Description
No description provided

setEntityId

script.zs
myMCPlayerEntity.setEntityId(id as int);
ParameterTypeDescription
Parameter
id
Type
int
Description
No description provided

setFire

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

script.zs
myMCPlayerEntity.setFire(seconds as int);
ParameterTypeDescription
Parameter
seconds
Type
int
Description
No description provided

setFireTimer

script.zs
myMCPlayerEntity.setFireTimer(p_223308_1_ as int);
ParameterTypeDescription
Parameter
p_223308_1_
Type
int
Description
No description provided

setGlowing

script.zs
myMCPlayerEntity.setGlowing(glowingIn as boolean);
ParameterTypeDescription
Parameter
glowingIn
Type
boolean
Description
No description provided

setHeadRotation

script.zs
myMCPlayerEntity.setHeadRotation(yaw as float, pitch as int);
ParameterTypeDescription
Parameter
yaw
Type
float
Description
No description provided
Parameter
pitch
Type
int
Description
No description provided

setHealth

script.zs
myMCPlayerEntity.setHealth(health as float);
ParameterTypeDescription
Parameter
health
Type
float
Description
No description provided

setIdleTime

script.zs
myMCPlayerEntity.setIdleTime(idleTimeIn as int);
ParameterTypeDescription
Parameter
idleTimeIn
Type
int
Description
No description provided

setInLava

script.zs
myMCPlayerEntity.setInLava();

setInvisible

script.zs
myMCPlayerEntity.setInvisible(invisible as boolean);
ParameterTypeDescription
Parameter
invisible
Type
boolean
Description
No description provided

setInvulnerable

Sets whether this Entity is invulnerable.

script.zs
myMCPlayerEntity.setInvulnerable(isInvulnerable as boolean);
ParameterTypeDescription
Parameter
isInvulnerable
Type
boolean
Description
No description provided

setJumping

script.zs
myMCPlayerEntity.setJumping(jumping as boolean);
ParameterTypeDescription
Parameter
jumping
Type
boolean
Description
No description provided

setLocationAndAngles

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

script.zs
myMCPlayerEntity.setLocationAndAngles(x as double, y as double, z as double, yaw as float, pitch as float);
ParameterTypeDescription
Parameter
x
Type
double
Description
No description provided
Parameter
y
Type
double
Description
No description provided
Parameter
z
Type
double
Description
No description provided
Parameter
yaw
Type
float
Description
No description provided
Parameter
pitch
Type
float
Description
No description provided

setMotion

script.zs
myMCPlayerEntity.setMotion(x as double, y as double, z as double);
ParameterTypeDescription
Parameter
x
Type
double
Description
No description provided
Parameter
y
Type
double
Description
No description provided
Parameter
z
Type
double
Description
No description provided

setNoGravity

script.zs
myMCPlayerEntity.setNoGravity(noGravity as boolean);
ParameterTypeDescription
Parameter
noGravity
Type
boolean
Description
No description provided

setPartying

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

script.zs
myMCPlayerEntity.setPartying(pos as crafttweaker.api.util.BlockPos, isPartying as boolean);
ParameterTypeDescription
Parameter
pos
Type
crafttweaker.api.util.BlockPos
Description
No description provided
Parameter
isPartying
Type
boolean
Description
No description provided

setPortal

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

script.zs
myMCPlayerEntity.setPortal(pos as crafttweaker.api.util.BlockPos);
ParameterTypeDescription
Parameter
pos
Type
crafttweaker.api.util.BlockPos
Description
No description provided

setPosition

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

script.zs
myMCPlayerEntity.setPosition(x as double, y as double, z as double);
ParameterTypeDescription
Parameter
x
Type
double
Description
No description provided
Parameter
y
Type
double
Description
No description provided
Parameter
z
Type
double
Description
No description provided

setPositionAndRotation

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

script.zs
myMCPlayerEntity.setPositionAndRotation(x as double, y as double, z as double, yaw as float, pitch as float);
ParameterTypeDescription
Parameter
x
Type
double
Description
No description provided
Parameter
y
Type
double
Description
No description provided
Parameter
z
Type
double
Description
No description provided
Parameter
yaw
Type
float
Description
No description provided
Parameter
pitch
Type
float
Description
No description provided

setPositionAndRotationDirect

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

script.zs
myMCPlayerEntity.setPositionAndRotationDirect(x as double, y as double, z as double, yaw as float, pitch as float, posRotationIncrements as int, teleport as boolean);
ParameterTypeDescription
Parameter
x
Type
double
Description
No description provided
Parameter
y
Type
double
Description
No description provided
Parameter
z
Type
double
Description
No description provided
Parameter
yaw
Type
float
Description
No description provided
Parameter
pitch
Type
float
Description
No description provided
Parameter
posRotationIncrements
Type
int
Description
No description provided
Parameter
teleport
Type
boolean
Description
No description provided

setPositionAndUpdate

Sets the position of the entity and updates the ‘last’ variables

script.zs
myMCPlayerEntity.setPositionAndUpdate(x as double, y as double, z as double);
ParameterTypeDescription
Parameter
x
Type
double
Description
No description provided
Parameter
y
Type
double
Description
No description provided
Parameter
z
Type
double
Description
No description provided

setPositionNonDirty

Returns boolean

script.zs
myMCPlayerEntity.setPositionNonDirty();

setReducedDebug

script.zs
myMCPlayerEntity.setReducedDebug(reducedDebug as boolean);
ParameterTypeDescription
Parameter
reducedDebug
Type
boolean
Description
No description provided

setRenderYawOffset

Set the render yaw offset

script.zs
myMCPlayerEntity.setRenderYawOffset(offset as float);
ParameterTypeDescription
Parameter
offset
Type
float
Description
No description provided

setRotationYawHead

Sets the head’s yaw rotation of the entity.

script.zs
myMCPlayerEntity.setRotationYawHead(rotation as float);
ParameterTypeDescription
Parameter
rotation
Type
float
Description
No description provided

setScore

Set player’s score

script.zs
myMCPlayerEntity.setScore(scoreIn as int);
ParameterTypeDescription
Parameter
scoreIn
Type
int
Description
No description provided

setSilent

When set to true the entity will not play sounds.

script.zs
myMCPlayerEntity.setSilent(isSilent as boolean);
ParameterTypeDescription
Parameter
isSilent
Type
boolean
Description
No description provided

setSneaking

Sets the sneaking flag.

script.zs
myMCPlayerEntity.setSneaking(sneaking as boolean);
ParameterTypeDescription
Parameter
sneaking
Type
boolean
Description
No description provided

setSpawnPoint

script.zs
myMCPlayerEntity.setSpawnPoint(pos as crafttweaker.api.util.BlockPos, forced as boolean);
ParameterTypeDescription
Parameter
pos
Type
crafttweaker.api.util.BlockPos
Description
No description provided
Parameter
forced
Type
boolean
Description
No description provided

setSprinting

Set sprinting switch for Entity.

script.zs
myMCPlayerEntity.setSprinting(sprinting as boolean);
ParameterTypeDescription
Parameter
sprinting
Type
boolean
Description
No description provided

setSwimming

script.zs
myMCPlayerEntity.setSwimming(p_204711_1_ as boolean);
ParameterTypeDescription
Parameter
p_204711_1_
Type
boolean
Description
No description provided

setVelocity

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

script.zs
myMCPlayerEntity.setVelocity(x as double, y as double, z as double);
ParameterTypeDescription
Parameter
x
Type
double
Description
No description provided
Parameter
y
Type
double
Description
No description provided
Parameter
z
Type
double
Description
No description provided

shouldHeal

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

Returns boolean

script.zs
myMCPlayerEntity.shouldHeal();

shouldReceiveErrors

Returns boolean

script.zs
myMCPlayerEntity.shouldReceiveErrors();

shouldReceiveFeedback

Returns boolean

script.zs
myMCPlayerEntity.shouldReceiveFeedback();

shouldRenderSneaking

Returns boolean

script.zs
myMCPlayerEntity.shouldRenderSneaking();

shouldRiderFaceForward

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

Returns boolean

script.zs
myMCPlayerEntity.shouldRiderFaceForward(player as crafttweaker.api.entity.player.MCPlayerEntity);
ParameterTypeDescription
Parameter
player
Type
crafttweaker.api.entity.player.MCPlayerEntity
Description
The player who is riding the entity.

shouldRiderSit

Returns boolean

script.zs
myMCPlayerEntity.shouldRiderSit();

spawnRunningParticles

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

script.zs
myMCPlayerEntity.spawnRunningParticles();

spawnSweepParticles

script.zs
myMCPlayerEntity.spawnSweepParticles();

startSleeping

script.zs
myMCPlayerEntity.startSleeping(p_213342_1_ as crafttweaker.api.util.BlockPos);
ParameterTypeDescription
Parameter
p_213342_1_
Type
crafttweaker.api.util.BlockPos
Description
No description provided

startSpinAttack

script.zs
myMCPlayerEntity.startSpinAttack(p_204803_1_ as int);
ParameterTypeDescription
Parameter
p_204803_1_
Type
int
Description
No description provided

stopActiveHand

script.zs
myMCPlayerEntity.stopActiveHand();

stopRiding

Dismounts this entity from the entity it is riding.

script.zs
myMCPlayerEntity.stopRiding();

teleportKeepLoaded

script.zs
myMCPlayerEntity.teleportKeepLoaded(p_223102_1_ as double, p_223102_3_ as double, p_223102_5_ as double);
ParameterTypeDescription
Parameter
p_223102_1_
Type
double
Description
No description provided
Parameter
p_223102_3_
Type
double
Description
No description provided
Parameter
p_223102_5_
Type
double
Description
No description provided

tick

Called to update the entity’s position/logic.

script.zs
myMCPlayerEntity.tick();

toString

Returns String

script.zs
myMCPlayerEntity.toString();

updateRidden

Handles updating while riding another entity

script.zs
myMCPlayerEntity.updateRidden();

updateSwimming

script.zs
myMCPlayerEntity.updateSwimming();

wakeUp

script.zs
myMCPlayerEntity.wakeUp();

wakeUpPlayer

Wake up the player if they’re sleeping.

script.zs
myMCPlayerEntity.wakeUpPlayer(immediately as boolean, updateWorldFlag as boolean, setSpawn as boolean);
ParameterTypeDescription
Parameter
immediately
Type
boolean
Description
No description provided
Parameter
updateWorldFlag
Type
boolean
Description
No description provided
Parameter
setSpawn
Type
boolean
Description
No 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.

Returns int

script.zs
myMCPlayerEntity.xpBarCap();