If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at
the top of the file.
import crafttweaker . api.entity.type.player . Player;
Player extends LivingEntity
.
Player
implements the following interfaces:
Nameable
,EntityAccess
,CommandSource
,IAttachmentHolder
Undocumented Interfaces IPlayerExtension
, Attackable
, ILivingEntityExtension
, SyncedDataHolder
, ScoreHolder
, IEntityExtension
, INBTSerializable <CompoundTag >
Gets the abilities of the player.
Return Type:
Abilities
Gets the abilities of the player. Returns : The abilities of the player.
Return Type:
Abilities
Gets the absorption amount for this entity. // Player.absorptionAmount as float
myPlayer . absorptionAmount
Return Type:
float
Gets the absorption amount for this entity. Returns : The absorption amount.
// Player.absorptionAmount() as float;
myPlayer . absorptionAmount();
Return Type:
float
Checks if the commands from this source should return failure messages // Player.acceptsFailure as bool
Return Type:
bool
Checks if the commands from this source should return failure messages Returns : True if the commands from this source should return failure messages, false otherwise.
// Player.acceptsFailure() as bool;
myPlayer . acceptsFailure();
Return Type:
bool
Checks if the commands from this source should return successful messages // Player.acceptsSuccess as bool
Return Type:
bool
Checks if the commands from this source should return successful messages Returns : True if the commands from this source should return successful messages, false otherwise.
// Player.acceptsSuccess() as bool;
myPlayer . acceptsSuccess();
Return Type:
bool
Gets a map of active effects. Returns : The active effects map.
myPlayer . activeEffectsMap();
Return Type:
MobEffectInstance [MobEffect ]
Adds an effect to this entity. Returns : True if the effect was added, false otherwise.
myPlayer . addEffect(myMobEffectInstance);
Return Type:
bool
Adds an effect to this entity. Returns : True if the effect was added, false otherwise.
myPlayer . addEffect(myMobEffectInstance, myEntity);
Parameters:
entity: Entity
Type: Entity
- The entity that is the source of the effect.
Return Type:
bool
Adds an item to the player's inventory. Returns : Whether the item was added.
// Player.addItem(stack as ItemStack ) as bool; myPlayer . addItem(myItemStack);
Return Type:
bool
Adds a tag to the entity, returning false if the entity has over 1024 Returns : true if the tag was added.
// Player.addTag(tagName as string) as bool;
myPlayer . addTag(myString);
Parameters:
tagName: string
Type: string
- The name of the tag to add.
Return Type:
bool
Gets the current air supply of the entity. // Player.airSupply as int
Return Type:
int
Gets the current air supply of the entity. Returns : The current air supply of the entity.
// Player.airSupply() as int;
Return Type:
int
Gets all slots.
Return Type:
Iterable <ItemStack >
Gets all slots. Returns : An iterable of item stacks representing all slots.
Return Type:
Iterable <ItemStack >
Checks if the command source always accepts. // Player.alwaysAccepts as bool
Return Type:
bool
Checks if the command source always accepts. Returns : True if the command source always accepts, false otherwise.
// Player.alwaysAccepts() as bool;
myPlayer . alwaysAccepts();
Return Type:
bool
Gets the armor cover percentage for this entity. This is a value from 0 to 1 that represents the percentage of the entity's body that is covered by armor. // Player.armorCoverPercentage as float
myPlayer . armorCoverPercentage
Return Type:
float
Gets the armor cover percentage for this entity. This is a value from 0 to 1 that represents the percentage of the entity's body that is covered by armor. Returns : The armor cover percentage.
// Player.armorCoverPercentage() as float;
myPlayer . armorCoverPercentage();
Return Type:
float
Gets this entity's armor items.
Return Type:
Iterable <ItemStack >
Gets this entity's armor items. Returns : An iterable of item stacks representing the armor items.
// Player.armorSlots() as Iterable< ItemStack >;
Return Type:
Iterable <ItemStack >
Gets the armor value for this entity. // Player.armorValue as int
Return Type:
int
Gets the armor value for this entity. Returns : The armor value.
// Player.armorValue() as int;
Return Type:
int
Gets how many arrows are currently in this entity. // Player.arrowCount as int
Return Type:
int
Gets how many arrows are currently in this entity. Returns : The arrow count.
// Player.arrowCount() as int;
Return Type:
int
Attacks an entity. // Player.attack(entity as Entity ); myPlayer . attack(myEntity);
Checks if the entity is attackable. // Player.attackable as bool
Return Type:
bool
Checks if the entity is attackable. Returns : True if the entity is attackable, false otherwise.
// Player.attackable() as bool;
Return Type:
bool
Awards a stat to the player. myPlayer . awardStat(myResourceLocation);
Awards a stat to the player. myPlayer . awardStat(myResourceLocation, myInt);
Parameters:
amount: int
Type: int
- The amount to award.
Gets the height of the bounding box of the entity. // Player.bbHeight as float
Return Type:
float
Gets the height of the bounding box of the entity. Returns : The height of the bounding box of the entity.
// Player.bbHeight() as float;
Return Type:
float
Gets the width of the bounding box of the entity. // Player.bbWidth as float
Return Type:
float
Gets the width of the bounding box of the entity. Returns : The width of the bounding box of the entity.
// Player.bbWidth() as float;
Return Type:
float
Gets the orientation of the bed that the entity is sleeping on.
Return Type:
Direction
Gets the orientation of the bed that the entity is sleeping on. Returns : The orientation of the bed that the entity is sleeping on.
myPlayer . bedOrientation();
Return Type:
Direction
Gets the position
of the entity. Returns : The block position of the entity.
myPlayer . blockPosition();
Return Type:
BlockPos
Gets the x coordinate of the entity.
Return Type:
int
Gets the x coordinate of the entity. Returns : The x coordinate of the entity.
// Player.blockX() as int;
Return Type:
int
Gets the y coordinate of the entity.
Return Type:
int
Gets the y coordinate of the entity. Returns : The y coordinate of the entity.
// Player.blockY() as int;
Return Type:
int
Gets the z coordinate of the entity.
Return Type:
int
Gets the z coordinate of the entity. Returns : The z coordinate of the entity.
// Player.blockZ() as int;
Return Type:
int
Gets the bounding box of the entity. // Player.boundingBox as AABB
Return Type:
AABB
Gets the bounding box of the entity. Returns : The bounding box of the entity.
// Player.boundingBox() as AABB ;
Return Type:
AABB
Gets the bounding box for culling of the entity. // Player.boundingBoxForCulling as AABB myPlayer . boundingBoxForCulling
Return Type:
AABB
Gets the bounding box for culling of the entity. Returns : The bounding box for culling of the entity.
// Player.boundingBoxForCulling() as AABB ; myPlayer . boundingBoxForCulling();
Return Type:
AABB
Checks if this entity can attack a target. Returns : True if this entity can attack the target, false otherwise.
myPlayer . canAttack(myLivingEntity);
Return Type:
bool
Checks if this entity can be affected by a specific effect. Returns : True if this entity can be affected by the effect, false otherwise.
myPlayer . canBeAffected(myMobEffectInstance);
Return Type:
bool
Checks if the entity can be collided with. // Player.canBeCollidedWith as bool
myPlayer . canBeCollidedWith
Return Type:
bool
Checks if the entity can be collided with. Returns : true if the entity can be collided with.
// Player.canBeCollidedWith() as bool;
myPlayer . canBeCollidedWith();
Return Type:
bool
Checks if this entity can be seen as an enemy. Some things this checks are if this entity is a player and it is in creative mode, or if this entity is an axolotl if it is playing dead. // Player.canBeSeenAsEnemy as bool
myPlayer . canBeSeenAsEnemy
Return Type:
bool
Checks if this entity can be seen as an enemy. Some things this checks are if this entity is a player and it is in creative mode, or if this entity is an axolotl if it is playing dead. Returns : True if this entity can be seen as an enemy, false otherwise.
// Player.canBeSeenAsEnemy() as bool;
myPlayer . canBeSeenAsEnemy();
Return Type:
bool
Checks if this entity can be seen by anyone. // Player.canBeSeenByAnyone as bool
myPlayer . canBeSeenByAnyone
Return Type:
bool
Checks if this entity can be seen by anyone. Returns : True if this entity can be seen by anyone, false otherwise.
// Player.canBeSeenByAnyone() as bool;
myPlayer . canBeSeenByAnyone();
Return Type:
bool
Checks if this entity can breathe underwater. // Player.canBreatheUnderwater as bool
myPlayer . canBreatheUnderwater
Return Type:
bool
Checks if this entity can breathe underwater. Returns : True if the entity can breathe underwater, false otherwise.
// Player.canBreatheUnderwater() as bool;
myPlayer . canBreatheUnderwater();
Return Type:
bool
Checks if the entity can collide with the given entity. Returns : true if the entity can collide with the given entity.
// Player.canCollideWith(other as Entity ) as bool; myPlayer . canCollideWith(myEntity);
Parameters:
other: Entity
Type: Entity
- The entity to check if the entity can collide with.
Return Type:
bool
Checks if the player can eat. Returns : Whether the player can eat.
// Player.canEat(ignoreHunger as bool) as bool;
Parameters:
ignoreHunger: bool
Type: bool
- Whether to ignore hunger.
Return Type:
bool
Checks if the entity can freeze. // Player.canFreeze as bool
Return Type:
bool
Checks if the entity can freeze. Returns : Whether the entity can freeze.
// Player.canFreeze() as bool;
Return Type:
bool
Checks if the player can harm another player. This does not check if pvp is enabled, it checks if players are on the same scoreboard team. Returns : Whether the player can harm the other player.
// Player.canHarmPlayer(player as Player ) as bool; myPlayer . canHarmPlayer(myPlayer);
Return Type:
bool
Checks if the entity can stand on a specific fluid. Returns : True if the entity can stand on the fluid, false otherwise.
// Player.canStandOnFluid(fluid as Fluid ) as bool; myPlayer . canStandOnFluid(myFluid);
Return Type:
bool
Checks if the item can be worn as armor. Returns : True if the item can be worn as armor, false otherwise.
// Player.canTakeItem(stack as ItemStack ) as bool; myPlayer . canTakeItem(myItemStack);
Return Type:
bool
Checks if the player can use game master blocks such as command blocks. // Player.canUseGameMasterBlocks as bool
myPlayer . canUseGameMasterBlocks
Return Type:
bool
Checks if the player can use game master blocks such as command blocks. Returns : Whether the player can use game master blocks.
// Player.canUseGameMasterBlocks() as bool;
myPlayer . canUseGameMasterBlocks();
Return Type:
bool
Adds food exhaustion to the player. // Player.causeFoodExhaustion(exhaustion as float);
myPlayer . causeFoodExhaustion(myFloat);
Parameters:
exhaustion: float
Type: float
- The amount of exhaustion to add.
Clears the fire of the entity.
Clears the position that the entity is sleeping at. // Player.clearSleepingPos();
myPlayer . clearSleepingPos();
Checks if the entity is closer than the given distance to another entity. Returns : true if the entity is closer than the given distance to the other entity.
// Player.closerThan(other as Entity , distance as double) as bool; myPlayer . closerThan(myEntity, myDouble);
Parameters:
other: Entity
Type: Entity
- The other entity to check the distance to. distance: double
Type: double
- The distance to check.
Return Type:
bool
Gets the Level
used when sending commands as this entity. // Player.commandSenderWorld as Level myPlayer . commandSenderWorld
Return Type:
Level
Gets the Level
used when sending commands as this entity. Returns : The Level
used when sending commands as this entity.
// Player.commandSenderWorld() as Level ; myPlayer . commandSenderWorld();
Return Type:
Level
Gets the controlling passenger of the entity. // Player.controllingPassenger as Entity myPlayer . controllingPassenger
Return Type:
Entity
Gets the controlling passenger of the entity. Returns : The controlling passenger of the entity.
// Player.controllingPassenger() as Entity ; myPlayer . controllingPassenger();
Return Type:
Entity
Gets the cooldowns of the player. Returns : The cooldowns of the player.
Return Type:
ItemCooldowns
Spawns critical hit particle at the hit entity. // Player.crit(entity as Entity );
Gets the current item attack strength delay of the player. // Player.currentItemAttackStrengthDelay as float
myPlayer . currentItemAttackStrengthDelay
Return Type:
float
Gets the current item attack strength delay of the player. Returns : The current item attack strength delay of the player.
// Player.currentItemAttackStrengthDelay() as float;
myPlayer . currentItemAttackStrengthDelay();
Return Type:
float
Gets the custom NBT data for this Entity.
Return Type:
MapData
Gets the custom NBT data for this Entity. Returns : The custom data for this Entity.
Return Type:
MapData
Gets the custom name of the entity.
Return Type:
Component
Gets the custom name of the entity. Returns : The custom name of the entity.
Return Type:
Component
Checks if the entity dampens vibrations, such as net.minecraft.world.entity.item.ItemEntity
s who's item is in the dampens_vibrations item tag. // Player.dampensVibrations as bool
myPlayer . dampensVibrations
Return Type:
bool
Checks if the entity dampens vibrations, such as net.minecraft.world.entity.item.ItemEntity
s who's item is in the dampens_vibrations item tag. Returns : true if the entity dampens vibrations.
// Player.dampensVibrations() as bool;
myPlayer . dampensVibrations();
Return Type:
bool
Gets the NBT data of this Entity.
Return Type:
MapData
Gets the NBT data of this Entity. Returns : The NBT data of this Entity.
Return Type:
MapData
Gets the delta movement of the entity. // Player.deltaMovement as Vec3
Return Type:
Vec3
Sets the delta movement of the entity. // Player.deltaMovement = (deltaMovement as Vec3 ); myPlayer . deltaMovement = myVec3;
Parameters:
deltaMovement: Vec3
Type: Vec3
- The delta movement to set. Gets the delta movement of the entity. Returns : The delta movement of the entity.
// Player.deltaMovement() as Vec3 ; myPlayer . deltaMovement();
Return Type:
Vec3
Sets the delta movement of the entity. // Player.deltaMovement(deltaMovement as Vec3 ); myPlayer . deltaMovement(myVec3);
Parameters:
deltaMovement: Vec3
Type: Vec3
- The delta movement to set. Kills this entity. myPlayer . die(myDamageSource);
Gets the dimension changing delay of the entity. // Player.dimensionChangingDelay as int
myPlayer . dimensionChangingDelay
Return Type:
int
Gets the dimension changing delay of the entity. Returns : The dimension changing delay of the entity.
// Player.dimensionChangingDelay() as int;
myPlayer . dimensionChangingDelay();
Return Type:
int
Gets the direction of the entity.
Return Type:
Direction
Gets the direction of the entity. Returns : The direction of the entity.
Return Type:
Direction
Disables the shield of the player. // Player.disableShield();
myPlayer . disableShield();
Checks if the entity dismounts underwater. // Player.dismountsUnderwater as bool
myPlayer . dismountsUnderwater
Return Type:
bool
Checks if the entity dismounts underwater. Returns : true if the entity dismounts underwater.
// Player.dismountsUnderwater() as bool;
myPlayer . dismountsUnderwater();
Return Type:
bool
Displays a message to the client. // Player.displayClientMessage(component as Component , actionBar as bool); myPlayer . displayClientMessage(myComponent, myBool);
Parameters:
actionBar: bool
Type: bool
- Whether to display the message in the action bar.
Gets the display name of the entity.
Return Type:
Component
Gets the display name of the entity. Returns : The display name of the entity.
Return Type:
Component
Gets the distance to the given entity. Returns : The distance to the given entity.
// Player.distanceTo(entity as Entity ) as float; myPlayer . distanceTo(myEntity);
Parameters:
entity: Entity
Type: Entity
- The entity to get the distance to.
Return Type:
float
Gets the squared distance to the given position. Returns : The squared distance to the given position.
// Player.distanceToSqr(x as double, y as double, z as double) as double;
myPlayer . distanceToSqr(myDouble, myDouble, myDouble);
Parameters:
x: double
Type: double
- The x position to get the squared distance to.
y: double
Type: double
- The y position to get the squared distance to.
z: double
Type: double
- The z position to get the squared distance to.
Return Type:
double
Gets the squared distance to the given entity. Returns : The squared distance to the given entity.
// Player.distanceToSqr(entity as Entity ) as double; myPlayer . distanceToSqr(myEntity);
Parameters:
entity: Entity
Type: Entity
- The entity to get the squared distance to.
Return Type:
double
Gets the squared distance to the given vector. Returns : The squared distance to the given vector.
// Player.distanceToSqr(vec as Vec3 ) as double; myPlayer . distanceToSqr(myVec3);
Parameters:
vec: Vec3
Type: Vec3
- The vector to get the squared distance to.
Return Type:
double
// Player.doHurtTarget(entity as Entity ) as bool; myPlayer . doHurtTarget(myEntity);
Return Type:
bool
Drops an item in the world as if the player dropped it. Returns : The item entity that was dropped.
myPlayer . drop(myItemStack, myBool);
Parameters:
traceItem: bool
Type: bool
- Whether to trace the item.
Return Type:
ItemEntity
Eats an item. Returns : The item that the entity ate.
myPlayer . eat(myLevel, myItemStack);
Parameters:
level: Level
Type: Level
- The level that the entity is in.
Return Type:
ItemStack
Ejects the passengers of the entity. // Player.ejectPassengers();
myPlayer . ejectPassengers();
Gets the enchantment seed of the player. // Player.enchantmentSeed as int
Return Type:
int
Gets the enchantment seed of the player. Returns : The enchantment seed of the player.
// Player.enchantmentSeed() as int;
myPlayer . enchantmentSeed();
Return Type:
int
Gets the experience level of the player. // Player.experienceLevel as int
Return Type:
int
Sets the experience level of the player. // Player.experienceLevel = (level as int);
myPlayer . experienceLevel = myInt;
Parameters:
level: int
Type: int
- The experience level to set.
Gets the experience level of the player. Returns : The experience level of the player.
// Player.experienceLevel() as int;
myPlayer . experienceLevel();
Return Type:
int
Sets the experience level of the player. // Player.experienceLevel(level as int);
myPlayer . experienceLevel(myInt);
Parameters:
level: int
Type: int
- The experience level to set.
Gets the eye height of the entity. // Player.eyeHeight as float
Return Type:
float
Gets the eye height of the entity. Returns : The eye height of the entity.
// Player.eyeHeight() as float;
Return Type:
float
Gets the eye position of the entity. // Player.eyePosition as Vec3
Return Type:
Vec3
Gets the eye position of the entity. Returns : The eye position of the entity.
// Player.eyePosition() as Vec3 ;
Return Type:
Vec3
Gets the y coordinate of the entity's eyes.
Return Type:
double
Gets the y coordinate of the entity's eyes. Returns : The y coordinate of the entity's eyes.
// Player.eyeY() as double;
Return Type:
double
Gets the ticks that the entity has been flying with an elytra. // Player.fallFlyingTicks as int
Return Type:
int
Gets the ticks that the entity has been flying with an elytra. Returns : The ticks that the entity has been flying with an elytra.
// Player.fallFlyingTicks() as int;
myPlayer . fallFlyingTicks();
Return Type:
int
Checks if the entity is fire immune. // Player.fireImmune as bool
Return Type:
bool
Checks if the entity is fire immune. Returns : true if the entity is fire immune.
// Player.fireImmune() as bool;
Return Type:
bool
Gets the remaining fire ticks of the entity. // Player.fireTicks as int
Return Type:
int
Sets the remaining fire ticks of the entity. // Player.fireTicks = (ticks as int);
myPlayer . fireTicks = myInt;
Parameters:
ticks: int
Type: int
- The number of ticks to set the remaining fire ticks to.
Sets the remaining fire ticks of the entity. // Player.fireTicks(ticks as int);
myPlayer . fireTicks(myInt);
Parameters:
ticks: int
Type: int
- The number of ticks to set the remaining fire ticks to.
Gets the remaining fire ticks of the entity. Returns : The remaining fire ticks of the entity.
// Player.fireTicks() as int;
Return Type:
int
Gets the first passenger of the entity. // Player.firstPassenger as Entity
Return Type:
Entity
Gets the first passenger of the entity. Returns : The first passenger of the entity.
// Player.firstPassenger() as Entity ; myPlayer . firstPassenger();
Return Type:
Entity
Gets the fluid jump threshold of the entity. // Player.fluidJumpThreshold as double
myPlayer . fluidJumpThreshold
Return Type:
double
Gets the fluid jump threshold of the entity. Returns : The fluid jump threshold of the entity.
// Player.fluidJumpThreshold() as double;
myPlayer . fluidJumpThreshold();
Return Type:
double
Gets the food data of the player.
Return Type:
FoodData
Gets the food data of the player. Returns : The food data of the player.
Return Type:
FoodData
Forces this entity to have a specific effect, this does not force effects that can't affect this entity. myPlayer . forceAddEffect(myMobEffectInstance, myEntity);
Parameters:
entity: Entity
Type: Entity
- The entity that is the source of the effect. Gets the forward vector of the entity. // Player.forward as Vec3
Return Type:
Vec3
Gets the forward vector of the entity. Returns : The forward vector of the entity.
// Player.forward() as Vec3 ;
Return Type:
Vec3
myPlayer . getAttachmentData < T>(myAttachmentType);
Return Type:
T
// Player.getAttachmentData<T>(type as Supplier< AttachmentType <T>>) as T; myPlayer . getAttachmentData < T>(mySupplier);
Return Type:
T
Gets the attribute for this entity. Returns : The attribute.
myPlayer . getAttribute(myAttribute);
Return Type:
AttributeInstance
Gets the base attribute value for this entity. Returns : The base attribute value.
// Player.getAttributeBaseValue(attribute as Attribute ) as double; myPlayer . getAttributeBaseValue(myAttribute);
Return Type:
double
Gets the attribute value for this entity. Returns : The attribute value.
// Player.getAttributeValue(attribute as Attribute ) as double; myPlayer . getAttributeValue(myAttribute);
Return Type:
double
Gets the destroy speed of the player for a given BlockState
. Returns : The destroy speed of the player for the given block state.
// Player.getDestroySpeed(state as BlockState ) as float; myPlayer . getDestroySpeed(myBlockState);
Return Type:
float
Gets the eye position of the entity. Returns : The eye position of the entity.
// Player.getEyePosition(partialTicks as float) as Vec3 ; myPlayer . getEyePosition(myFloat);
Parameters:
partialTicks: float
Type: float
- The partial ticks to get the eye position for.
Return Type:
Vec3
Gets the item in a specific slot. Returns : The item in the slot.
myPlayer . getItemBySlot(myEquipmentSlot);
Return Type:
ItemStack
Gets the item in the entity's hand. Returns : The item in the hand.
myPlayer . getItemInHand(myInteractionHand);
Return Type:
ItemStack
Gets the position of the entity. Returns : The position of the entity.
// Player.getPosition(partialTicks as float) as Vec3 ; myPlayer . getPosition(myFloat);
Parameters:
partialTicks: float
Type: float
- The partial ticks to get the position for.
Return Type:
Vec3
Gets the swim amount. Returns : The swim amount.
// Player.getSwimAmount(partialTicks as float) as float;
myPlayer . getSwimAmount(myFloat);
Parameters:
partialTicks: float
Type: float
- The partial ticks to get the swim amount for.
Return Type:
float
Gets the up vector of the entity. Returns : The up vector of the entity.
// Player.getUpVector(partialTicks as float) as Vec3 ; myPlayer . getUpVector(myFloat);
Parameters:
partialTicks: float
Type: float
- The partial ticks to get the up vector for.
Return Type:
Vec3
Gets the view vector of the entity. Returns : The view vector of the entity.
// Player.getViewVector(partialTicks as float) as Vec3 ; myPlayer . getViewVector(myFloat);
Parameters:
partialTicks: float
Type: float
- The partial ticks to get the view vector for.
Return Type:
Vec3
Gets the visibility percent for this entity. Returns : The visibility percent.
// Player.getVisibilityPercent(lookingEntity as Entity ) as double; myPlayer . getVisibilityPercent(myEntity);
Parameters:
lookingEntity: Entity
Type: Entity
- The entity that is looking at this entity.
Return Type:
double
Gets the x coordinate of the entity with the given scale. Returns : The x coordinate of the entity.
// Player.getX(scale as double) as double;
Parameters:
scale: double
Type: double
- The scale to get the x coordinate of the entity.
Return Type:
double
Gets the y coordinate of the entity with the given scale. Returns : The y coordinate of the entity.
// Player.getY(scale as double) as double;
Parameters:
scale: double
Type: double
- The scale to get the y coordinate of the entity.
Return Type:
double
Gets the z coordinate of the entity with the given scale. Returns : The z coordinate of the entity.
// Player.getZ(scale as double) as double;
Parameters:
scale: double
Type: double
- The scale to get the z coordinate of the entity.
Return Type:
double
Gives the player an item. // Player.give(stack as IItemStack , slot as int = -1); myPlayer . give(myIItemStack, myInt);
Parameters:
slot: int
(optional) Type: int
- The slot to give the item to.
Default Value: -1
Gives the player experience levels. // Player.giveExperienceLevels(levels as int);
myPlayer . giveExperienceLevels(myInt);
Parameters:
levels: int
Type: int
- The amount of experience levels to give.
Gives the player experience points. // Player.giveExperiencePoints(amount as int);
myPlayer . giveExperiencePoints(myInt);
Parameters:
amount: int
Type: int
- The amount of experience to give.
Gets this entity's held items.
Return Type:
Iterable <ItemStack >
Gets this entity's held items. Returns : An iterable of item stacks representing the held items.
// Player.handSlots() as Iterable< ItemStack >;
Return Type:
Iterable <ItemStack >
myPlayer . hasAttachmentData < T>(myAttachmentType);
Return Type:
bool
// Player.hasAttachmentData<T>(type as Supplier< AttachmentType <T>>) as bool; myPlayer . hasAttachmentData < T>(mySupplier);
Return Type:
bool
Checks if the player has the correct tool for the given BlockState
. Returns : Whether the player has the correct tool for the given block state.
// Player.hasCorrectToolForDrops(state as BlockState ) as bool; myPlayer . hasCorrectToolForDrops(myBlockState);
Return Type:
bool
Checks if the entity has a custom name. // Player.hasCustomName as bool
Return Type:
bool
// Player.hasCustomName as bool
Return Type:
bool
Checks if the entity has a custom name. Returns : true if the entity has a custom name.
// Player.hasCustomName() as bool;
myPlayer . hasCustomName();
Return Type:
bool
// Player.hasCustomName() as bool;
myPlayer . hasCustomName();
Return Type:
bool
Checks if this entity has a specific effect. Returns : True if this entity has the effect, false otherwise.
// Player.hasEffect(effect as MobEffect ) as bool; myPlayer . hasEffect(myMobEffect);
Return Type:
bool
Checks if the entity has exactly one player passenger. // Player.hasExactlyOnePlayerPassenger as bool
myPlayer . hasExactlyOnePlayerPassenger
Return Type:
bool
Checks if the entity has exactly one player passenger. Returns : true if the entity has exactly one player passenger.
// Player.hasExactlyOnePlayerPassenger() as bool;
myPlayer . hasExactlyOnePlayerPassenger();
Return Type:
bool
Checks if the entity is currently glowing. // Player.hasGlowingTag as bool
Return Type:
bool
Checks if the entity is currently glowing. Returns : true if the entity is currently glowing.
// Player.hasGlowingTag() as bool;
myPlayer . hasGlowingTag();
Return Type:
bool
Checks if the entity has an indirect passenger. Returns : true if the entity has an indirect passenger.
// Player.hasIndirectPassenger(entity as Entity ) as bool; myPlayer . hasIndirectPassenger(myEntity);
Return Type:
bool
Checks if the entity has an item in a specific slot. Returns : True if the entity has an item in the slot, false otherwise.
myPlayer . hasItemInSlot(myEquipmentSlot);
Return Type:
bool
Checks if this entity has a line of sight to a specific entity. Returns : True if the entity has a line of sight to the entity, false otherwise.
// Player.hasLineOfSight(entity as Entity ) as bool; myPlayer . hasLineOfSight(myEntity);
Parameters:
entity: Entity
Type: Entity
- The entity to check the line of sight to.
Return Type:
bool
Checks if the entity has a passenger. Returns : true if the entity has the given passenger.
// Player.hasPassenger(entity as Entity ) as bool; myPlayer . hasPassenger(myEntity);
Return Type:
bool
Checks if the entity has a passenger that matches the given predicate. Returns : true if the entity has a passenger that matches the predicate.
// Player.hasPassenger(predicate as function(t as Entity ) as bool) as bool; myPlayer . hasPassenger(myPredicate);
Parameters:
predicate: function(t as Entity ) as bool
Type: function(t as Entity ) as bool
- The predicate to check.
Return Type:
bool
Heals this entity. // Player.heal(amount as float);
Parameters:
amount: float
Type: float
- The amount to heal.
Gets the health of this entity. // Player.health as float
Return Type:
float
Gets the health of this entity. Returns : The health of this entity.
// Player.health() as float;
Return Type:
float
Hurts the entity with the given DamageSource
and amount. Returns : true if the entity was hurt.
// Player.hurt(source as DamageSource , amount as float) as bool; myPlayer . hurt(myDamageSource, myFloat);
Parameters:
amount: float
Type: float
- The amount of damage to deal.
Return Type:
bool
Gets the ID of the entity.
Return Type:
int
Gets the ID of the entity. Returns : The ID of the entity.
Return Type:
int
Gets the BlockState
that this entity is currently inside. Returns : The block state that this entity is currently inside
Return Type:
BlockState
Increases the score of the player. // Player.increaseScore(score as int);
myPlayer . increaseScore(myInt);
Parameters:
score: int
Type: int
- The score to increase.
Gets the inventory of the player.
Return Type:
Inventory
Gets the inventory of the player. Returns : The inventory of the player.
Return Type:
Inventory
Checks if the entity is affected by potions, entities such as armor stands are not affected by potions. // Player.isAffectedByPotions as bool
myPlayer . isAffectedByPotions
Return Type:
bool
Checks if the entity is affected by potions, entities such as armor stands are not affected by potions. Returns : True if the entity is affected by potions, false otherwise.
// Player.isAffectedByPotions() as bool;
myPlayer . isAffectedByPotions();
Return Type:
bool
Checks if the entity is alive. // Player.isAlive as bool
Return Type:
bool
Checks if the entity is alive. Returns : true if the entity is alive.
// Player.isAlive() as bool;
Return Type:
bool
Checks if the entity is always ticking. // Player.isAlwaysTicking as bool
Return Type:
bool
Checks if the entity is always ticking. Returns : true if the entity is always ticking.
// Player.isAlwaysTicking() as bool;
myPlayer . isAlwaysTicking();
Return Type:
bool
Checks if the entity is attackable. // Player.isAttackable as bool
Return Type:
bool
Checks if the entity is attackable. Returns : true if the entity is attackable.
// Player.isAttackable() as bool;
Return Type:
bool
Checks if this entity is performing an auto spin attack. // Player.isAutoSpinAttack as bool
myPlayer . isAutoSpinAttack
Return Type:
bool
Checks if this entity is performing an auto spin attack. Returns : True if the entity is performing an auto spin attack, false otherwise.
// Player.isAutoSpinAttack() as bool;
myPlayer . isAutoSpinAttack();
Return Type:
bool
Checks if this entity is a baby.
Return Type:
bool
Checks if this entity is a baby. Returns : True if the entity is a baby, false otherwise.
// Player.isBaby() as bool;
Return Type:
bool
Checks if the entity is blocking. // Player.isBlocking as bool
Return Type:
bool
Checks if the entity is blocking. Returns : True if the entity is blocking, false otherwise.
// Player.isBlocking() as bool;
Return Type:
bool
Checks if this entity is colliding with the given BlockState
at the given BlockPos
. Returns : true if the entity is colliding with the block.
myPlayer . isColliding(myBlockPos, myBlockState);
Return Type:
bool
Checks if the player is creative. // Player.isCreative as bool
Return Type:
bool
Checks if the player is creative. Returns : Whether the player is creative.
// Player.isCreative() as bool;
Return Type:
bool
Checks if the entity is crouching. // Player.isCrouching as bool
Return Type:
bool
Checks if the entity is crouching. Returns : true if the entity is crouching.
// Player.isCrouching() as bool;
Return Type:
bool
Checks if the entity is currently glowing. // Player.isCurrentlyGlowing as bool
myPlayer . isCurrentlyGlowing
Return Type:
bool
Checks if the entity is currently glowing. // Player.isCurrentlyGlowing as bool
myPlayer . isCurrentlyGlowing
Return Type:
bool
Checks if the entity is currently glowing. Returns : True if the entity is currently glowing, false otherwise.
// Player.isCurrentlyGlowing() as bool;
myPlayer . isCurrentlyGlowing();
Return Type:
bool
Checks if the entity is currently glowing. Returns : true if the entity is currently glowing.
// Player.isCurrentlyGlowing() as bool;
myPlayer . isCurrentlyGlowing();
Return Type:
bool
Checks if the custom name of the entity is visible. // Player.isCustomNameVisible as bool
myPlayer . isCustomNameVisible
Return Type:
bool
Checks if the custom name of the entity is visible. Returns : true if the custom name is visible.
// Player.isCustomNameVisible() as bool;
myPlayer . isCustomNameVisible();
Return Type:
bool
Determines whether the entity can block the damage source based on the damage source's location, whether the damage source is blockable, and whether the entity is blocking. Returns : True if the entity can block the damage source, false otherwise.
// Player.isDamageSourceBlocked(source as DamageSource ) as bool; myPlayer . isDamageSourceBlocked(myDamageSource);
Return Type:
bool
Checks if this entity is dead or dying. // Player.isDeadOrDying as bool
Return Type:
bool
Checks if this entity is dead or dying. Returns : True if this entity is dead or dying, false otherwise.
// Player.isDeadOrDying() as bool;
myPlayer . isDeadOrDying();
Return Type:
bool
Checks if the entity is descending. // Player.isDescending as bool
Return Type:
bool
Checks if the entity is descending. Returns : true if the entity is descending.
// Player.isDescending() as bool;
Return Type:
bool
Checks if the entity is being discrete. // Player.isDiscrete as bool
Return Type:
bool
Checks if the entity is being discrete. Returns : true if the entity is being discrete.
// Player.isDiscrete() as bool;
Return Type:
bool
Checks if this player is a fake player, mainly used for machines. // Player.isFakePlayer as bool
Return Type:
bool
Checks if the entity is flying with an elytra. // Player.isFallFlying as bool
Return Type:
bool
Checks if the entity is flying with an elytra. Returns : True if the entity is flying with an elytra, false otherwise.
// Player.isFallFlying() as bool;
Return Type:
bool
Checks if the offset position from the entity's current position has a collision with a block or a liquid. Returns : true if the entity is free to move in the given position.
// Player.isFree(x as double, y as double, z as double) as bool;
myPlayer . isFree(myDouble, myDouble, myDouble);
Parameters:
x: double
Type: double
- The x position to check.
y: double
Type: double
- The y position to check.
z: double
Type: double
- The z position to check.
Return Type:
bool
Checks if the entity is fully frozen. // Player.isFullyFrozen as bool
Return Type:
bool
Checks if the entity is fully frozen. Returns : true if the entity is fully frozen.
// Player.isFullyFrozen() as bool;
myPlayer . isFullyFrozen();
Return Type:
bool
Checks if the entity is holding an item in their hand. Returns : True if the entity is holding the item, false otherwise.
myPlayer . isHolding(myItem);
Return Type:
bool
Checks if the entity is holding an item in their hand. Returns : True if the entity is holding the item, false otherwise.
// Player.isHolding(predicate as function(t as ItemStack ) as bool) as bool; myPlayer . isHolding(myPredicate);
Parameters:
predicate: function(t as ItemStack ) as bool
Type: function(t as ItemStack ) as bool
- The predicate to check.
Return Type:
bool
Checks if the player is hurt.
Return Type:
bool
Checks if the player is hurt. Returns : Whether the player is hurt.
// Player.isHurt() as bool;
Return Type:
bool
Checks if the entity is in lava. // Player.isInLava as bool
Return Type:
bool
Checks if the entity is in lava. Returns : true if the entity is in lava.
// Player.isInLava() as bool;
Return Type:
bool
Checks if this entity is inverted for heal and harm. This usually happens for undead mobs where potions of healing with harm them. // Player.isInvertedHealAndHarm as bool
myPlayer . isInvertedHealAndHarm
Return Type:
bool
Checks if this entity is inverted for heal and harm. This usually happens for undead mobs where potions of healing with harm them. Returns : True if this entity is inverted for heal and harm, false otherwise.
// Player.isInvertedHealAndHarm() as bool;
myPlayer . isInvertedHealAndHarm();
Return Type:
bool
Checks if the entity is invisible. // Player.isInvisible as bool
Return Type:
bool
Checks if the entity is invisible. Returns : true if the entity is invisible.
// Player.isInvisible() as bool;
Return Type:
bool
Checks if the entity is invisible to the given Player
. Returns : true if the entity is invisible to the player.
// Player.isInvisibleTo(player as Player ) as bool; myPlayer . isInvisibleTo(myPlayer);
Return Type:
bool
Checks if the entity is invulnerable. // Player.isInvulnerable as bool
Return Type:
bool
Checks if the entity is invulnerable. Returns : true if the entity is invulnerable.
// Player.isInvulnerable() as bool;
myPlayer . isInvulnerable();
Return Type:
bool
Checks if the entity is invulnerable to the given DamageSource
. Returns : true if the entity is invulnerable to the damage source.
myPlayer . isInvulnerableTo(myDamageSource);
Return Type:
bool
Checks if the entity is in a wall. // Player.isInWall as bool
Return Type:
bool
Checks if the entity is in a wall. Returns : true if the entity is in a wall.
// Player.isInWall() as bool;
Return Type:
bool
Checks if the entity is in water. // Player.isInWater as bool
Return Type:
bool
Checks if the entity is in water. Returns : true if the entity is in water.
// Player.isInWater() as bool;
Return Type:
bool
Checks if the entity is in water or a bubble column. // Player.isInWaterOrBubble as bool
myPlayer . isInWaterOrBubble
Return Type:
bool
Checks if the entity is in water or a bubble column. Returns : true if the entity is in water or a bubble column.
// Player.isInWaterOrBubble() as bool;
myPlayer . isInWaterOrBubble();
Return Type:
bool
Checks if the entity is in water or rain. // Player.isInWaterOrRain as bool
Return Type:
bool
Checks if the entity is in water or rain. Returns : true if the entity is in water or rain.
// Player.isInWaterOrRain() as bool;
myPlayer . isInWaterOrRain();
Return Type:
bool
Checks if the entity is in water or rain or a bubble column. // Player.isInWaterRainOrBubble as bool
myPlayer . isInWaterRainOrBubble
Return Type:
bool
Checks if the entity is in water or rain or a bubble column. Returns : true if the entity is in water or rain or a bubble column.
// Player.isInWaterRainOrBubble() as bool;
myPlayer . isInWaterRainOrBubble();
Return Type:
bool
Checks if the player is the local player. // Player.isLocalPlayer as bool
Return Type:
bool
Checks if the player is the local player. Returns : Whether the player is the local player.
// Player.isLocalPlayer() as bool;
myPlayer . isLocalPlayer();
Return Type:
bool
Checks if the entity has no gravity. // Player.isNoGravity as bool
Return Type:
bool
Checks if the entity has no gravity. Returns : true if the entity has no gravity.
// Player.isNoGravity() as bool;
Return Type:
bool
Checks if the entity is on fire. // Player.isOnFire as bool
Return Type:
bool
Checks if the entity is on fire. Returns : true if the entity is on fire.
// Player.isOnFire() as bool;
Return Type:
bool
Checks if the entity is on portal cooldown. // Player.isOnPortalCooldown as bool
myPlayer . isOnPortalCooldown
Return Type:
bool
Checks if the entity is on portal cooldown. Returns : true if the entity is on portal cooldown.
// Player.isOnPortalCooldown() as bool;
myPlayer . isOnPortalCooldown();
Return Type:
bool
Checks if the entity is a passenger. // Player.isPassenger as bool
Return Type:
bool
Checks if the entity is a passenger. Returns : true if the entity is a passenger.
// Player.isPassenger() as bool;
Return Type:
bool
Checks if the entity is a passenger of the same vehicle. Returns : true if the entity is a passenger of the same vehicle.
// Player.isPassengerOfSameVehicle(entity as Entity ) as bool; myPlayer . isPassengerOfSameVehicle(myEntity);
Return Type:
bool
Checks if the entity is pickable. // Player.isPickable as bool
Return Type:
bool
Checks if the entity is pickable. Returns : true if the entity is pickable.
// Player.isPickable() as bool;
Return Type:
bool
Checks if the entity is pushable. // Player.isPushable as bool
Return Type:
bool
Checks if the entity is pushable. Returns : true if the entity is pushable.
// Player.isPushable() as bool;
Return Type:
bool
Checks if the entity is pushed by fluid. // Player.isPushedByFluid as bool
Return Type:
bool
Checks if the entity is pushed by fluid. Returns : true if the entity is pushed by fluid.
// Player.isPushedByFluid() as bool;
myPlayer . isPushedByFluid();
Return Type:
bool
Checks if the player has reduced debug info. // Player.isReducedDebugInfo as bool
myPlayer . isReducedDebugInfo
Return Type:
bool
Checks if the player has reduced debug info. Returns : Whether the player has reduced debug info.
// Player.isReducedDebugInfo() as bool;
myPlayer . isReducedDebugInfo();
Return Type:
bool
Checks if the entity has been removed. // Player.isRemoved as bool
Return Type:
bool
Checks if the entity has been removed. Returns : Whether the entity has been removed.
// Player.isRemoved() as bool;
Return Type:
bool
Checks if the player is scoping like when using a SpyGlass. // Player.isScoping as bool
Return Type:
bool
Checks if the player is scoping like when using a SpyGlass. Returns : Whether the player is scoping.
// Player.isScoping() as bool;
Return Type:
bool
Checks if the secondary use is active, this usually means that the player is sneaking. // Player.isSecondaryUseActive as bool
myPlayer . isSecondaryUseActive
Return Type:
bool
Checks if the secondary use is active, this usually means that the player is sneaking. Returns : Whether the secondary use is active.
// Player.isSecondaryUseActive() as bool;
myPlayer . isSecondaryUseActive();
Return Type:
bool
Checks if this entity is sensitive to water, meaning that it will take damage from being in water. // Player.isSensitiveToWater as bool
myPlayer . isSensitiveToWater
Return Type:
bool
Checks if this entity is sensitive to water, meaning that it will take damage from being in water. Returns : True if the entity is sensitive to water, false otherwise.
// Player.isSensitiveToWater() as bool;
myPlayer . isSensitiveToWater();
Return Type:
bool
Checks if the shift key is down. // Player.isShiftKeyDown as bool
Return Type:
bool
Checks if the shift key is down. Returns : true if the shift key is down.
// Player.isShiftKeyDown() as bool;
myPlayer . isShiftKeyDown();
Return Type:
bool
Checks if the entity is silent, meaning it won't play any sounds. // Player.isSilent as bool
Return Type:
bool
Checks if the entity is silent, meaning it won't play any sounds. Returns : true if the entity is silent.
// Player.isSilent() as bool;
Return Type:
bool
Checks if the entity is sleeping. // Player.isSleeping as bool
Return Type:
bool
Checks if the entity is sleeping. Returns : True if the entity is sleeping, false otherwise.
// Player.isSleeping() as bool;
Return Type:
bool
Checks if the player has been in bed long enough to trigger sleeping. // Player.isSleepingLongEnough as bool
myPlayer . isSleepingLongEnough
Return Type:
bool
Checks if the player has been in bed long enough to trigger sleeping. Returns : Whether the player has been sleeping long enough.
// Player.isSleepingLongEnough() as bool;
myPlayer . isSleepingLongEnough();
Return Type:
bool
Checks if the entity is a spectator. // Player.isSpectator as bool
Return Type:
bool
Checks if the entity is a spectator. Returns : true if the entity is a spectator.
// Player.isSpectator() as bool;
Return Type:
bool
Checks if the entity is sprinting. // Player.isSprinting as bool
Return Type:
bool
Checks if the entity is sprinting. Returns : true if the entity is sprinting.
// Player.isSprinting() as bool;
Return Type:
bool
Checks if the entity is stepping carefully. // Player.isSteppingCarefully as bool
myPlayer . isSteppingCarefully
Return Type:
bool
Checks if the entity is stepping carefully. Returns : true if the entity is stepping carefully.
// Player.isSteppingCarefully() as bool;
myPlayer . isSteppingCarefully();
Return Type:
bool
Checks if the entity is suppressing bounce. // Player.isSuppressingBounce as bool
myPlayer . isSuppressingBounce
Return Type:
bool
Checks if the entity is suppressing bounce. Returns : true if the entity is suppressing bounce.
// Player.isSuppressingBounce() as bool;
myPlayer . isSuppressingBounce();
Return Type:
bool
Checks if the entity is suppressing sliding down a ladder, such as sneaking while on a ladder. // Player.isSuppressingSlidingDownLadder as bool
myPlayer . isSuppressingSlidingDownLadder
Return Type:
bool
Checks if the entity is suppressing sliding down a ladder, such as sneaking while on a ladder. Returns : True if the entity is suppressing sliding down a ladder, false otherwise.
// Player.isSuppressingSlidingDownLadder() as bool;
myPlayer . isSuppressingSlidingDownLadder();
Return Type:
bool
Checks if the entity is swimming. // Player.isSwimming as bool
Return Type:
bool
Checks if the entity is swimming. Returns : true if the entity is swimming.
// Player.isSwimming() as bool;
Return Type:
bool
Checks if the entity is underwater. // Player.isUnderWater as bool
Return Type:
bool
Checks if the entity is underwater. Returns : true if the entity is underwater.
// Player.isUnderWater() as bool;
Return Type:
bool
Checks if this entity is using an item. // Player.isUsingItem as bool
Return Type:
bool
Checks if this entity is using an item. Returns : True if the entity is using an item, false otherwise.
// Player.isUsingItem() as bool;
Return Type:
bool
Checks if the entity is a vehicle. // Player.isVehicle as bool
Return Type:
bool
Checks if the entity is a vehicle. Returns : true if the entity is a vehicle.
// Player.isVehicle() as bool;
Return Type:
bool
Checks if the entity is visually crawling. // Player.isVisuallyCrawling as bool
myPlayer . isVisuallyCrawling
Return Type:
bool
Checks if the entity is visually crawling. Returns : true if the entity is visually crawling.
// Player.isVisuallyCrawling() as bool;
myPlayer . isVisuallyCrawling();
Return Type:
bool
Checks if the entity is visually swimming. // Player.isVisuallySwimming as bool
myPlayer . isVisuallySwimming
Return Type:
bool
Checks if the entity is visually swimming. // Player.isVisuallySwimming as bool
myPlayer . isVisuallySwimming
Return Type:
bool
Checks if the entity is visually swimming. Returns : True if the entity is visually swimming, false otherwise.
// Player.isVisuallySwimming() as bool;
myPlayer . isVisuallySwimming();
Return Type:
bool
Checks if the entity is visually swimming. Returns : true if the entity is visually swimming.
// Player.isVisuallySwimming() as bool;
myPlayer . isVisuallySwimming();
Return Type:
bool
Gets the jump boost power for this entity. // Player.jumpBoostPower as double
Return Type:
double
Gets the jump boost power for this entity. Returns : The jump boost power.
// Player.jumpBoostPower() as double;
myPlayer . jumpBoostPower();
Return Type:
double
Makes the player jump from the ground. // Player.jumpFromGround();
myPlayer . jumpFromGround();
Gets the kill credit for this entity. If this entity was last hit by a player, then it will be that player, otherwise it will be the last mob that hit this entity.
Return Type:
LivingEntity
Gets the kill credit for this entity. If this entity was last hit by a player, then it will be that player, otherwise it will be the last mob that hit this entity. Returns : The kill credit.
Return Type:
LivingEntity
Knocks back this entity. // Player.knockback(x as double, y as double, z as double);
myPlayer . knockback(myDouble, myDouble, myDouble);
Parameters:
x: double
Type: double
- The x coordinate to knock back to.
y: double
Type: double
- The y coordinate to knock back to.
z: double
Type: double
- The z coordinate to knock back to.
Gets the last climbable position for this entity. myPlayer . lastClimbablePos
Return Type:
BlockPos
Gets the last climbable position for this entity. Returns : The last climbable position.
// Player.lastClimbablePos() as BlockPos ; myPlayer . lastClimbablePos();
Return Type:
BlockPos
Gets the last damage source for this entity. myPlayer . lastDamageSource
Return Type:
DamageSource
Gets the last damage source for this entity. Returns : The last damage source.
myPlayer . lastDamageSource();
Return Type:
DamageSource
Gets the last entity that hurt this entity.
Return Type:
LivingEntity
Gets the last entity that hurt this entity. Returns : The last entity that hurt this entity.
myPlayer . lastHurtByMob();
Return Type:
LivingEntity
Gets the timestamp when this entity was last hurt by a mob. // Player.lastHurtByMobTimestamp as int
myPlayer . lastHurtByMobTimestamp
Return Type:
int
Gets the timestamp when this entity was last hurt by a mob. Returns : The timestamp when this entity was last hurt by a mob.
// Player.lastHurtByMobTimestamp() as int;
myPlayer . lastHurtByMobTimestamp();
Return Type:
int
Gets the last entity that this entity hurt.
Return Type:
LivingEntity
Gets the last entity that this entity hurt. Returns : The last entity that this entity hurt.
Return Type:
LivingEntity
Gets the timestamp when this entity last hurt a mob. // Player.lastHurtMobTimestamp as int
myPlayer . lastHurtMobTimestamp
Return Type:
int
Gets the timestamp when this entity last hurt a mob. Returns : The timestamp when this entity last hurt a mob.
// Player.lastHurtMobTimestamp() as int;
myPlayer . lastHurtMobTimestamp();
Return Type:
int
Causes the entity to take damage from lava.
Gets the look angle of the entity. // Player.lookAngle as Vec3
Return Type:
Vec3
Gets the look angle of the entity. Returns : The look angle of the entity.
// Player.lookAngle() as Vec3 ;
Return Type:
Vec3
Gets the loot table for this entity. Returns : The loot table.
Return Type:
ResourceLocation
Gets the seed used when generating loot from this entity. // Player.lootTableSeed as long
Return Type:
long
Gets the luck of the player.
Return Type:
float
Gets the luck of the player. Returns : The luck of the player.
// Player.luck() as float;
Return Type:
float
Spawns magic critical hit particle at the hit entity. // Player.magicCrit(entity as Entity ); myPlayer . magicCrit(myEntity);
Gets the main arm of the player.
Return Type:
HumanoidArm
Gets the main arm of the player. Returns : The main arm of the player.
Return Type:
HumanoidArm
Gets the main hand item for this entity.
Return Type:
ItemStack
Gets the main hand item for this entity. Returns : The main hand item.
Return Type:
ItemStack
Gets the maximum air supply of the entity. // Player.maxAirSupply as int
Return Type:
int
Gets the maximum air supply of the entity. Returns : The maximum air supply of the entity.
// Player.maxAirSupply() as int;
Return Type:
int
Gets the maximum fall distance of the entity. // Player.maxFallDistance as int
Return Type:
int
Gets the maximum fall distance of the entity. Returns : The maximum fall distance of the entity.
// Player.maxFallDistance() as int;
myPlayer . maxFallDistance();
Return Type:
int
Gets the maximum health for this entity. // Player.maxHealth as float
Return Type:
float
Gets the maximum health for this entity. Returns : The maximum health.
// Player.maxHealth() as float;
Return Type:
float
Checks if the player may build. // Player.mayBuild as bool
Return Type:
bool
Checks if the player may build. Returns : Whether the player may build.
// Player.mayBuild() as bool;
Return Type:
bool
Gets the motion direction of the entity.
Return Type:
Direction
Gets the motion direction of the entity. Returns : The motion direction of the entity.
myPlayer . motionDirection();
Return Type:
Direction
Moves the entity relative to its current position. // Player.moveRelative(amount as float, relative as Vec3 ); myPlayer . moveRelative(myFloat, myVec3);
Parameters:
amount: float
Type: float
- The amount to move the entity by.
relative: Vec3
Type: Vec3
- The relative position to move the entity by. Moves the entity to the given position. // Player.moveTo(vec as Vec3 );
Parameters:
vec: Vec3
Type: Vec3
- The position to move the entity to. Moves the entity to the given position. // Player.moveTo(x as double, y as double, z as double);
myPlayer . moveTo(myDouble, myDouble, myDouble);
Parameters:
x: double
Type: double
- The x position to move the entity to.
y: double
Type: double
- The y position to move the entity to.
z: double
Type: double
- The z position to move the entity to.
Moves the entity to the given position. // Player.moveTo(pos as BlockPos , yaw as float, pitch as float); myPlayer . moveTo(myBlockPos, myFloat, myFloat);
Parameters:
yaw: float
Type: float
- The yaw to move the entity to.
pitch: float
Type: float
- The pitch to move the entity to.
Moves the entity to the given position. // Player.moveTo(x as double, y as double, z as double, yaw as float, pitch as float);
myPlayer . moveTo(myDouble, myDouble, myDouble, myFloat, myFloat);
Parameters:
x: double
Type: double
- The x position to move the entity to.
y: double
Type: double
- The y position to move the entity to.
z: double
Type: double
- The z position to move the entity to.
yaw: float
Type: float
- The yaw to move the entity to.
pitch: float
Type: float
- The pitch to move the entity to.
Gets the name of the entity.
Return Type:
Component
Gets the name of the entity. Returns : The name of the entity.
Return Type:
Component
Gets the time since this entity last performed an action. // Player.noActionTime as int
Return Type:
int
Gets the time since this entity last performed an action. Returns : The time since this entity last performed an action.
// Player.noActionTime() as int;
Return Type:
int
Gets the offhand item for this entity.
Return Type:
ItemStack
Gets the offhand item for this entity. Returns : The offhand item.
Return Type:
ItemStack
Checks if the entity is on the ground. // Player.onGround as bool
Return Type:
bool
Gets the position of the entity on the ground.
Return Type:
BlockPos
Gets the position of the entity on the ground. Returns : The position of the entity on the ground.
Return Type:
BlockPos
Gets the passengers of the entity. // Player.passengers as List< Entity >
Return Type:
List <Entity >
Gets the passengers of the entity. Returns : The passengers of the entity.
// Player.passengers() as List< Entity >;
Return Type:
List <Entity >
Gets the percent the entity is frozen. // Player.percentFrozen as float
Return Type:
float
Gets the percent the entity is frozen. Returns : The percent the entity is frozen.
// Player.percentFrozen() as float;
myPlayer . percentFrozen();
Return Type:
float
Gets the piston push reaction of the entity. myPlayer . pistonPushReaction
Return Type:
PushReaction
Gets the piston push reaction of the entity. Returns : The piston push reaction of the entity.
myPlayer . pistonPushReaction();
Return Type:
PushReaction
Plays a sound for the player. myPlayer . playNotifySound(mySoundEvent, mySoundSource, myFloat, myFloat);
Parameters:
volume: float
Type: float
- The volume of the sound.
pitch: float
Type: float
- The pitch of the sound.
Plays a sound at the entity's location. // Player.playSound(sound as SoundEvent , volume as float, pitch as float); myPlayer . playSound(mySoundEvent, myFloat, myFloat);
Parameters:
volume: float
Type: float
- The volume of the sound.
pitch: float
Type: float
- The pitch of the sound.
Gets the position of the entity. // Player.position as Vec3
Return Type:
Vec3
Gets the position of the entity. Returns : The position of the entity.
// Player.position() as Vec3 ;
Return Type:
Vec3
Positions the rider of the entity. // Player.positionRider(entity as Entity ); myPlayer . positionRider(myEntity);
Parameters:
entity: Entity
Type: Entity
- The entity to position the rider of. Gets this entity's random source. Returns : The random source for the entity.
Return Type:
RandomSource
Gets the registry name of the entity. Returns : The registry name of the entity.
Return Type:
ResourceLocation
Releases the item that the entity is using. // Player.releaseUsingItem();
myPlayer . releaseUsingItem();
Removes all effects from this entity. Returns : True if all effects were removed, false otherwise.
// Player.removeAllEffects() as bool;
myPlayer . removeAllEffects();
Return Type:
bool
Removes an effect from this entity. Returns : True if the effect was removed, false otherwise.
// Player.removeEffect(effect as MobEffect ) as bool; myPlayer . removeEffect(myMobEffect);
Return Type:
bool
Removes an effect from this entity without causing an update. Returns : The removed effect.
myPlayer . removeEffectNoUpdate(myMobEffect);
Return Type:
MobEffectInstance
Removes a tag from the entity. Returns : true if the tag was removed.
// Player.removeTag(tagName as string) as bool;
myPlayer . removeTag(myString);
Parameters:
tagName: string
Type: string
- The name of the tag to remove.
Return Type:
bool
Removes the vehicle of the entity. // Player.removeVehicle();
myPlayer . removeVehicle();
Gets the root vehicle of the entity. // Player.rootVehicle as Entity
Return Type:
Entity
Gets the root vehicle of the entity. Returns : The root vehicle of the entity.
// Player.rootVehicle() as Entity ;
Return Type:
Entity
Gets this entity's scale.
Return Type:
float
Gets this entity's scale. Returns : The scale of the entity.
// Player.scale() as float;
Return Type:
float
Gets the score of the player.
Return Type:
int
Gets the score of the player. Returns : The score of the player.
// Player.score() as int;
Return Type:
int
Sends a message to the player. myPlayer . sendMessage(myComponent);
Sets the absorption amount for this entity. // Player.setAbsorptionAmount(absorption as float);
myPlayer . setAbsorptionAmount(myFloat);
Parameters:
absorption: float
Type: float
- The absorption amount to set.
Sets the air supply of the entity. // Player.setAirSupply(air as int);
myPlayer . setAirSupply(myInt);
Parameters:
air: int
Type: int
- The new air supply of the entity.
Sets how many arrows are currently in this entity. // Player.setArrowCount(count as int);
myPlayer . setArrowCount(myInt);
Parameters:
count: int
Type: int
- The number of arrows to set.
// Player.setAttachmentData<T>(type as AttachmentType <T>, data as T) as T?; myPlayer . setAttachmentData < T>(myAttachmentType, myT);
Return Type:
T ?
// Player.setAttachmentData<T>(type as Supplier< AttachmentType <T>>, data as T) as T?; myPlayer . setAttachmentData < T>(mySupplier, myT);
Return Type:
T ?
Sets the custom name of the entity. myPlayer . setCustomName(myComponent);
Sets the custom name visible state of the entity. // Player.setCustomNameVisible(visible as bool);
myPlayer . setCustomNameVisible(myBool);
Parameters:
visible: bool
Type: bool
- true if the custom name should be visible.
Sets the delta movement of the entity. // Player.setDeltaMovement(xDelta as double, yDelta as double, zDelta as double);
myPlayer . setDeltaMovement(myDouble, myDouble, myDouble);
Parameters:
xDelta: double
Type: double
- The x delta movement to set.
yDelta: double
Type: double
- The y delta movement to set.
zDelta: double
Type: double
- The z delta movement to set.
Sets if this entity should discard friction. // Player.setDiscardFriction(discardFriction as bool);
myPlayer . setDiscardFriction(myBool);
Parameters:
discardFriction: bool
Type: bool
- True if this entity should discard friction, false otherwise.
Sets an entity on the player's shoulder. Returns : Whether the entity was set.
// Player.setEntityOnShoulder(entityData as MapData ) as bool; myPlayer . setEntityOnShoulder(myMapData);
Return Type:
bool
Makes the entity glow. // Player.setGlowingTag(glowing as bool);
myPlayer . setGlowingTag(myBool);
Parameters:
glowing: bool
Type: bool
- true if the entity should be glowing.
Sets the health of this entity. // Player.setHealth(health as float);
myPlayer . setHealth(myFloat);
Parameters:
health: float
Type: float
- The health to set.
Sets the invisible state of the entity. // Player.setInvisible(invisible as bool);
myPlayer . setInvisible(myBool);
Parameters:
invisible: bool
Type: bool
- true if the entity should be invisible.
Sets the invulnerable state of the entity. // Player.setInvulnerable(invulnerable as bool);
myPlayer . setInvulnerable(myBool);
Parameters:
invulnerable: bool
Type: bool
- true if the entity should be invulnerable.
Sets whether the entity is in powder snow. // Player.setIsInPowderSnow(inPowderSnow as bool);
myPlayer . setIsInPowderSnow(myBool);
Parameters:
inPowderSnow: bool
Type: bool
- Whether the entity is in powder snow.
Sets the item in the entity's hand. myPlayer . setItemInHand(myInteractionHand, myItemStack);
Sets the item in a specific equipment slot. myPlayer . setItemSlot(myEquipmentSlot, myItemStack);
Sets whether this entity is jumping. // Player.setJumping(jumping as bool);
myPlayer . setJumping(myBool);
Parameters:
jumping: bool
Type: bool
- True if the entity should jump, false otherwise.
Sets the last entity that hurt this entity. myPlayer . setLastHurtByMob(myLivingEntity);
Sets the last entity that hurt this entity. // Player.setLastHurtByPlayer(player as Player ); myPlayer . setLastHurtByPlayer(myPlayer);
Parameters:
player: Player
Type: Player
- The player that hurt this entity. Sets the last entity that this entity hurt. // Player.setLastHurtMob(entity as Entity ); myPlayer . setLastHurtMob(myEntity);
Parameters:
entity: Entity
Type: Entity
- The entity that this entity hurt. Sets the main arm of the player. myPlayer . setMainArm(myHumanoidArm);
Sets the time since this entity last performed an action. // Player.setNoActionTime(idleTime as int);
myPlayer . setNoActionTime(myInt);
Parameters:
idleTime: int
Type: int
- The time since this entity last performed an action.
Sets if the entity has no gravity. // Player.setNoGravity(noGravity as bool);
myPlayer . setNoGravity(myBool);
Parameters:
noGravity: bool
Type: bool
- The no gravity state to set the entity to.
Sets the old position and rotation of the entity. // Player.setOldPosAndRot();
myPlayer . setOldPosAndRot();
Sets if the entity is on the ground. // Player.setOnGround(onGround as bool);
myPlayer . setOnGround(myBool);
Parameters:
onGround: bool
Type: bool
- The on ground state to set the entity to.
Sets the portal cooldown of the entity. // Player.setPortalCooldown();
myPlayer . setPortalCooldown();
Sets the position of the entity. // Player.setPos(position as Vec3 );
Parameters:
position: Vec3
Type: Vec3
- The position to set the entity to. Sets the position of the entity. // Player.setPos(x as double, y as double, z as double);
myPlayer . setPos(myDouble, myDouble, myDouble);
Parameters:
x: double
Type: double
- The x position to set the entity to.
y: double
Type: double
- The y position to set the entity to.
z: double
Type: double
- The z position to set the entity to.
Sets the position of the entity to the given coordinates. // Player.setPosRaw(x as double, y as double, z as double);
myPlayer . setPosRaw(myDouble, myDouble, myDouble);
Parameters:
x: double
Type: double
- The x coordinate to set the position to.
y: double
Type: double
- The y coordinate to set the position to.
z: double
Type: double
- The z coordinate to set the position to.
Sets if the player has reduced debug info. // Player.setReducedDebugInfo(reducedDebugInfo as bool);
myPlayer . setReducedDebugInfo(myBool);
Parameters:
reducedDebugInfo: bool
Type: bool
- Whether the player has reduced debug info.
Removes this entity with the given removal reason . myPlayer . setRemoved(myRemovalReason);
Sets the score of the player. // Player.setScore(score as int);
myPlayer . setScore(myInt);
Parameters:
score: int
Type: int
- The score to set.
Sets the shift key down state of the entity. // Player.setShiftKeyDown(keyDown as bool);
myPlayer . setShiftKeyDown(myBool);
Parameters:
keyDown: bool
Type: bool
- true if the shift key is down.
Sets if the entity is silent. // Player.setSilent(silent as bool);
myPlayer . setSilent(myBool);
Parameters:
silent: bool
Type: bool
- The silent state to set the entity to.
Sets the position that the entity is sleeping at. // Player.setSleepingPos(pos as BlockPos ); myPlayer . setSleepingPos(myBlockPos);
Sets the movement speed of this entity. // Player.setSpeed(speed as float);
myPlayer . setSpeed(myFloat);
Parameters:
speed: float
Type: float
- The movement speed to set.
Sets the sprinting state of the entity. // Player.setSprinting(sprinting as bool);
myPlayer . setSprinting(myBool);
Parameters:
sprinting: bool
Type: bool
- true if the entity should be sprinting.
Sets how many stingers are currently in this entity. // Player.setStingerCount(count as int);
myPlayer . setStingerCount(myInt);
Parameters:
count: int
Type: int
- The number of stingers to set.
Sets the swimming state of the entity. // Player.setSwimming(swimming as bool);
myPlayer . setSwimming(myBool);
Parameters:
swimming: bool
Type: bool
- true if the entity should be swimming.
Sets the number of ticks the entity has been frozen. // Player.setTicksFrozen(ticks as int);
myPlayer . setTicksFrozen(myInt);
Parameters:
ticks: int
Type: int
- The new number of ticks the entity has been frozen.
Checks if the entity should be saved. // Player.shouldBeSaved as bool
Return Type:
bool
Checks if the entity should be saved. Returns : true if the entity should be saved.
// Player.shouldBeSaved() as bool;
myPlayer . shouldBeSaved();
Return Type:
bool
Checks if this entity should discard friction. // Player.shouldDiscardFriction as bool
myPlayer . shouldDiscardFriction
Return Type:
bool
Checks if this entity should discard friction. Returns : True if this entity should discard friction, false otherwise.
// Player.shouldDiscardFriction() as bool;
myPlayer . shouldDiscardFriction();
Return Type:
bool
Gets the entity on the player's left shoulder. // Player.shoulderEntityLeft as MapData myPlayer . shoulderEntityLeft
Return Type:
MapData
Gets the entity on the player's left shoulder. Returns : The entity on the player's left shoulder.
// Player.shoulderEntityLeft() as MapData ; myPlayer . shoulderEntityLeft();
Return Type:
MapData
Gets the entity on the player's right shoulder. // Player.shoulderEntityRight as MapData myPlayer . shoulderEntityRight
Return Type:
MapData
Gets the entity on the player's right shoulder. Returns : The entity on the player's right shoulder.
// Player.shoulderEntityRight() as MapData ; myPlayer . shoulderEntityRight();
Return Type:
MapData
Checks if the commands from this source should inform admins. // Player.shouldInformAdmins as bool
myPlayer . shouldInformAdmins
Return Type:
bool
Checks if the commands from this source should inform admins. Returns : True if the commands from this source should inform admins, false otherwise.
// Player.shouldInformAdmins() as bool;
myPlayer . shouldInformAdmins();
Return Type:
bool
Checks if the entity should show its name. // Player.shouldShowName as bool
Return Type:
bool
Checks if the entity should show its name. Returns : true if the entity should show its name.
// Player.shouldShowName() as bool;
myPlayer . shouldShowName();
Return Type:
bool
Checks if the entity should show vehicle health. // Player.showVehicleHealth as bool
myPlayer . showVehicleHealth
Return Type:
bool
Checks if the entity should show vehicle health. Returns : true if the entity should show vehicle health.
// Player.showVehicleHealth() as bool;
myPlayer . showVehicleHealth();
Return Type:
bool
Gets the position that the entity is sleeping at.
Return Type:
BlockPos
Gets the position that the entity is sleeping at. Returns : The position that the entity is sleeping at.
Return Type:
BlockPos
Gets the sleep timer of the player. // Player.sleepTimer as int
Return Type:
int
Gets the sleep timer of the player. Returns : The sleep timer of the player.
// Player.sleepTimer() as int;
Return Type:
int
Gets the movement speed of this entity.
Return Type:
float
Gets the movement speed of this entity. Returns : The movement speed of the entity.
// Player.speed() as float;
Return Type:
float
Starts riding the given entity. Returns : true if the entity started riding.
// Player.startRiding(entity as Entity ) as bool; myPlayer . startRiding(myEntity);
Return Type:
bool
Starts riding the given entity. Returns : true if the entity started riding.
// Player.startRiding(entity as Entity , force as bool) as bool; myPlayer . startRiding(myEntity, myBool);
Parameters:
force: bool
Type: bool
- true if the entity should be forced to start riding.
Return Type:
bool
Starts the entity to sleep at a specific position. // Player.startSleeping(pos as BlockPos ); myPlayer . startSleeping(myBlockPos);
Starts using an item. myPlayer . startUsingItem(myInteractionHand);
Gets how many stingers are currently in this entity. // Player.stingerCount as int
Return Type:
int
Gets how many stingers are currently in this entity. Returns : The stinger count.
// Player.stingerCount() as int;
Return Type:
int
Wakes up the player if they are sleeping // Player.stopSleeping();
Stops using an item. // Player.stopUsingItem();
myPlayer . stopUsingItem();
Gets the UUID of the entity as a string. // Player.stringUUID as string
Return Type:
string
Gets the UUID of the entity as a string. Returns : The UUID of the entity as a string.
// Player.stringUUID() as string;
Return Type:
string
Spawns a sweep attack particle.
Swings the entity's main hand. myPlayer . swing(myInteractionHand);
Swings the entity's main hand. myPlayer . swing(myInteractionHand, myBool);
Parameters:
updateSelf: bool
Type: bool
- Whether to update the entity's self.
Gets the tags of the entity. These tags are arbitrary strings that can be attached to an entity. A single entity is limited to 1024. // Player.tags as Set<string>
Return Type:
Set <string >
Gets the tags of the entity. These tags are arbitrary strings that can be attached to an entity. A single entity is limited to 1024. Returns : The tags of the entity.
// Player.tags() as Set<string>;
Return Type:
Set <string >
Gets the team color of the entity. // Player.teamColor as int
Return Type:
int
Gets the team color of the entity. Returns : The team color of the entity.
// Player.teamColor() as int;
Return Type:
int
Teleports the entity to the given position. // Player.teleportTo(x as double, y as double, z as double);
myPlayer . teleportTo(myDouble, myDouble, myDouble);
Parameters:
x: double
Type: double
- The x coordinate to teleport to.
y: double
Type: double
- The y coordinate to teleport to.
z: double
Type: double
- The z coordinate to teleport to.
Gets the number of ticks the entity has been frozen. // Player.ticksFrozen as int
Return Type:
int
Gets the number of ticks the entity has been frozen. Returns : The number of ticks the entity has been frozen.
// Player.ticksFrozen() as int;
Return Type:
int
Gets the number of ticks required to freeze the entity. // Player.ticksRequiredToFreeze as int
myPlayer . ticksRequiredToFreeze
Return Type:
int
Gets the number of ticks required to freeze the entity. Returns : The number of ticks required to freeze the entity.
// Player.ticksRequiredToFreeze() as int;
myPlayer . ticksRequiredToFreeze();
Return Type:
int
Gets how long the entity has been using an item. // Player.ticksUsingItem as int
Return Type:
int
Gets how long the entity has been using an item. Returns : The ticks that the entity has been using an item.
// Player.ticksUsingItem() as int;
myPlayer . ticksUsingItem();
Return Type:
int
Moves this entity towards the given location. // Player.travel(vec as Vec3 );
Parameters:
vec: Vec3
Type: Vec3
- The direction to move in. Turns the entity. // Player.turn(yaw as double, pitch as double);
myPlayer . turn(myDouble, myDouble);
Parameters:
yaw: double
Type: double
- The yaw to turn the entity to.
pitch: double
Type: double
- The pitch to turn the entity to.
Removes any passengers and stops riding the current entity.
Updates the custom NBT data for this Entity. // Player.updateCustomData(data as MapData ); myPlayer . updateCustomData({custom: "data" });
myPlayer . updateCustomEntityTag(myLevel, myPlayer, myMapData);
Updates the NBT data of this Entity. // Player.updateData(data as MapData ); myPlayer . updateData({key: "value" });
Gets the hand that the entity is using an item with.
Return Type:
InteractionHand
Gets the hand that the entity is using an item with. Returns : The hand that the entity is using an item with.
Return Type:
InteractionHand
Gets the item that the entity is using.
Return Type:
ItemStack
Gets the item that the entity is using. Returns : The item that the entity is using.
Return Type:
ItemStack
Gets the remaining ticks left of the use duration of the item that is being used. // Player.useItemRemainingTicks as int
myPlayer . useItemRemainingTicks
Return Type:
int
Gets the remaining ticks left of the use duration of the item that is being used. Returns : The remaining ticks for the item that the entity is using.
// Player.useItemRemainingTicks() as int;
myPlayer . useItemRemainingTicks();
Return Type:
int
Gets the UUID of the entity.
Return Type:
UUID
Gets the UUID of the entity. Returns : The UUID of the entity.
// Player.uuid() as UUID;
Return Type:
UUID
Gets the vehicle of the entity.
Return Type:
Entity
Gets the vehicle of the entity. Returns : The vehicle of the entity.
// Player.vehicle() as Entity ;
Return Type:
Entity
Gets the voice pitch for this entity. // Player.voicePitch as float
Return Type:
float
Gets the voice pitch for this entity. Returns : The voice pitch.
// Player.voicePitch() as float;
Return Type:
float
Gets the x coordinate of the entity.
Return Type:
double
Gets the x coordinate of the entity. Returns : The x coordinate of the entity.
Return Type:
double
Gets the amount of experience needed to reach the next level. // Player.xpNeededForNextLevel as int
myPlayer . xpNeededForNextLevel
Return Type:
int
Gets the amount of experience needed to reach the next level. Returns : The amount of experience needed to reach the next level.
// Player.xpNeededForNextLevel() as int;
myPlayer . xpNeededForNextLevel();
Return Type:
int
Gets the y coordinate of the entity.
Return Type:
double
Gets the y coordinate of the entity. Returns : The y coordinate of the entity.
Return Type:
double
Gets the z coordinate of the entity.
Return Type:
double
Gets the z coordinate of the entity. Returns : The z coordinate of the entity.
Return Type:
double