Importing the class

Link to 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 at the very top of the file.

ZenScript
Copy
import crafttweaker.api.entity.type.player.Player;

Extending LivingEntity

Link to extending-livingentity

Player extends LivingEntity. That means all methods available in LivingEntity are also available in Player

Link to g-

Name: addItem

Return Type: boolean

ZenScript
Copy
Player.addItem(stack as ItemStack) as boolean
ParameterTypeDescription
Parameter
stack
Type
Pila de objetos
Description
No Description Provided

Name: attack

Return Type: void

ZenScript
Copy
Player.attack(entity as Entity) as void
ParameterTypeDescription
Parameter
entity
Type
Entity
Description
No Description Provided

Link to g--2

Name: awardStat

Return Type: void

ZenScript
Copy
Player.awardStat(stat as ResourceLocation) as void
ParameterTypeDescription
Parameter
stat
Type
ResourceLocation
Description
No Description Provided

Link to g--3

Name: awardStat

Return Type: void

ZenScript
Copy
Player.awardStat(stat as ResourceLocation, amount as int) as void
ParameterTypeDescription
Parameter
stat
Type
ResourceLocation
Description
No Description Provided
Parameter
amount
Type
int
Description
No Description Provided

Name: canEat

Return Type: boolean

ZenScript
Copy
Player.canEat(ignoreHunger as boolean) as boolean
ParameterTypeDescription
Parameter
ignoreHunger
Type
boolean
Description
No Description Provided

Link to g--5

Name: canHarmPlayer

Return Type: boolean

ZenScript
Copy
Player.canHarmPlayer(player as Player) as boolean
ParameterTypeDescription
Parameter
player
Type
Player
Description
No Description Provided

Link to g--6

Name: canUseGameMasterBlocks

Return Type: boolean

ZenScript
Copy
// Player.canUseGameMasterBlocks() as boolean

myPlayer.canUseGameMasterBlocks();

Link to g--7

Name: causeFoodExhaustion

Return Type: void

ZenScript
Copy
Player.causeFoodExhaustion(exhaustion as float) as void
ParameterTypeDescription
Parameter
exhaustion
Type
float
Description
No Description Provided

Name: crit

Return Type: void

ZenScript
Copy
Player.crit(entity as Entity) as void
ParameterTypeDescription
Parameter
entity
Type
Entity
Description
No Description Provided

Link to g--9

Name: disableShield

Return Type: void

ZenScript
Copy
Player.disableShield(usingAxe as boolean) as void
ParameterTypeDescription
Parameter
usingAxe
Type
boolean
Description
No Description Provided

Link to g--10

Name: displayClientMessage

Return Type: void

ZenScript
Copy
Player.displayClientMessage(component as Component, actionBar as boolean) as void
ParameterTypeDescription
Parameter
component
Type
Component
Description
No Description Provided
Parameter
actionBar
Type
boolean
Description
No Description Provided

Name: drop

Return Type: ItemEntity

ZenScript
Copy
Player.drop(stack as ItemStack, traceItem as boolean) as ItemEntity
ParameterTypeDescription
Parameter
stack
Type
Pila de objetos
Description
No Description Provided
Parameter
traceItem
Type
boolean
Description
No Description Provided

Link to g--12

Name: getAbilities

Return Type: Abilities

ZenScript
Copy
// Player.getAbilities() as Abilities

myPlayer.getAbilities();

Link to g--13

Name: getCooldowns

Return Type: ItemCooldowns

ZenScript
Copy
// Player.getCooldowns() as ItemCooldowns

myPlayer.getCooldowns();

Link to g--14

Name: getCurrentItemAttackStrengthDelay

Return Type: float

ZenScript
Copy
// Player.getCurrentItemAttackStrengthDelay() as float

myPlayer.getCurrentItemAttackStrengthDelay();

Link to g--15

Name: getDestroySpeed

Return Type: float

ZenScript
Copy
Player.getDestroySpeed(state as BlockState) as float
ParameterTypeDescription
Parameter
state
Type
BlockState
Description
No Description Provided

Link to g--16

Name: getEnchantmentSeed

Return Type: int

ZenScript
Copy
// Player.getEnchantmentSeed() as int

myPlayer.getEnchantmentSeed();

Link to g--17

Name: getFoodData

Return Type: FoodData

ZenScript
Copy
// Player.getFoodData() as FoodData

myPlayer.getFoodData();

Link to g--18

Name: getInventory

Return Type: Inventory

ZenScript
Copy
// Player.getInventory() as Inventory

myPlayer.getInventory();

Name: getLuck

Return Type: float

ZenScript
Copy
// Player.getLuck() as float

myPlayer.getLuck();

Link to g--20

Name: getMainArm

Return Type: HumanoidArm

ZenScript
Copy
// Player.getMainArm() as HumanoidArm

myPlayer.getMainArm();

Name: getScore

Return Type: int

ZenScript
Copy
// Player.getScore() as int

myPlayer.getScore();

Link to g--22

Name: getShoulderEntityLeft

Return Type: MapData

ZenScript
Copy
// Player.getShoulderEntityLeft() as MapData

myPlayer.getShoulderEntityLeft();

Link to g--23

Name: getShoulderEntityRight

Return Type: MapData

ZenScript
Copy
// Player.getShoulderEntityRight() as MapData

myPlayer.getShoulderEntityRight();

Link to g--24

Name: getSleepTimer

Return Type: int

ZenScript
Copy
// Player.getSleepTimer() as int

myPlayer.getSleepTimer();

Link to g--25

Name: getXpNeededForNextLevel

Return Type: int

ZenScript
Copy
// Player.getXpNeededForNextLevel() as int

myPlayer.getXpNeededForNextLevel();

Name: give

Return Type: void

ZenScript
Copy
Player.give(stack as IItemStack, slot as int) as void
ParameterTypeDescriptionOptionalDefaultValue
Parameter
stack
Type
IItemStack
Description
No Description Provided
Optional
false
DefaultValue
‚Äč
Parameter
slot
Type
int
Description
No Description Provided
Optional
true
DefaultValue
-1

Link to g--27

Name: giveExperienceLevels

Return Type: void

ZenScript
Copy
Player.giveExperienceLevels(levels as int) as void
ParameterTypeDescription
Parameter
levels
Type
int
Description
No Description Provided

Link to g--28

Name: giveExperiencePoints

Return Type: void

ZenScript
Copy
Player.giveExperiencePoints(amount as int) as void
ParameterTypeDescription
Parameter
amount
Type
int
Description
No Description Provided

Link to g--29

Name: hasCorrectToolForDrops

Return Type: boolean

ZenScript
Copy
Player.hasCorrectToolForDrops(state as BlockState) as boolean
ParameterTypeDescription
Parameter
state
Type
BlockState
Description
No Description Provided

Link to g--30

Name: increaseScore

Return Type: void

ZenScript
Copy
Player.increaseScore(score as int) as void
ParameterTypeDescription
Parameter
score
Type
int
Description
No Description Provided

Link to g--31

Name: isCreative

Return Type: boolean

ZenScript
Copy
// Player.isCreative() as boolean

myPlayer.isCreative();

Name: isHurt

Return Type: boolean

ZenScript
Copy
// Player.isHurt() as boolean

myPlayer.isHurt();

Link to g--33

Name: isLocalPlayer

Return Type: boolean

ZenScript
Copy
// Player.isLocalPlayer() as boolean

myPlayer.isLocalPlayer();

Link to g--34

Name: isReducedDebugInfo

Return Type: boolean

ZenScript
Copy
// Player.isReducedDebugInfo() as boolean

myPlayer.isReducedDebugInfo();

Link to g--35

Name: isScoping

Return Type: boolean

ZenScript
Copy
// Player.isScoping() as boolean

myPlayer.isScoping();

Link to g--36

Name: isSecondaryUseActive

Return Type: boolean

ZenScript
Copy
// Player.isSecondaryUseActive() as boolean

myPlayer.isSecondaryUseActive();

Link to g--37

Name: isSleepingLongEnough

Return Type: boolean

ZenScript
Copy
// Player.isSleepingLongEnough() as boolean

myPlayer.isSleepingLongEnough();

Link to g--38

Name: jumpFromGround

Return Type: void

ZenScript
Copy
// Player.jumpFromGround() as void

myPlayer.jumpFromGround();

Link to g--39

Name: magicCrit

Return Type: void

ZenScript
Copy
Player.magicCrit(entity as Entity) as void
ParameterTypeDescription
Parameter
entity
Type
Entity
Description
No Description Provided

Name: mayBuild

Return Type: boolean

ZenScript
Copy
// Player.mayBuild() as boolean

myPlayer.mayBuild();

Link to g--41

Name: playNotifySound

Return Type: void

ZenScript
Copy
Player.playNotifySound(event as SoundEvent, source as SoundSource, volume as float, pitch as float) as void
ParameterTypeDescription
Parameter
event
Type
SoundEvent
Description
No Description Provided
Parameter
fuente
Type
SoundSource
Description
No Description Provided
Parameter
volume
Type
float
Description
No Description Provided
Parameter
pitch
Type
float
Description
No Description Provided

Name: respawn

Return Type: void

ZenScript
Copy
// Player.respawn() as void

myPlayer.respawn();

Link to g--43

Name: sendMessage

Return Type: void

ZenScript
Copy
Player.sendMessage(text as Component) as void
ParameterTypeDescription
Parameter
texto
Type
Component
Description
No Description Provided

Link to g--44

Name: setEntityOnShoulder

Return Type: boolean

ZenScript
Copy
Player.setEntityOnShoulder(entityData as MapData) as boolean
ParameterTypeDescription
Parameter
entityData
Type
MapData
Description
No Description Provided

Link to g--45

Name: setMainArm

Return Type: void

ZenScript
Copy
Player.setMainArm(arm as HumanoidArm) as void
ParameterTypeDescription
Parameter
arm
Type
HumanoidArm
Description
No Description Provided

Link to g--46

Name: setReducedDebugInfo

Return Type: void

ZenScript
Copy
Player.setReducedDebugInfo(reducedDebugInfo as boolean) as void
ParameterTypeDescription
Parameter
reducedDebugInfo
Type
boolean
Description
No Description Provided

Name: setScore

Return Type: void

ZenScript
Copy
Player.setScore(score as int) as void
ParameterTypeDescription
Parameter
score
Type
int
Description
No Description Provided

Link to g--48

Name: stopSleeping

Return Type: void

ZenScript
Copy
// Player.stopSleeping() as void

myPlayer.stopSleeping();

Link to g--49

Name: sweepAttack

Return Type: void

ZenScript
Copy
// Player.sweepAttack() as void

myPlayer.sweepAttack();
NombreTypeHas GetterHas SetterDescription
Nombre
abilities
Type
Abilities
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
canUseGameMasterBlocks
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
cooldowns
Type
ItemCooldowns
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
currentItemAttackStrengthDelay
Type
float
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
enchantmentSeed
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
foodData
Type
FoodData
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
inventory
Type
Inventario
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
isCreative
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
isHurt
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
isLocalPlayer
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
isReducedDebugInfo
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
isScoping
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
isSecondaryUseActive
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
isSleepingLongEnough
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
luck
Type
float
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
mainArm
Type
HumanoidArm
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
mayBuild
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
score
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
shoulderEntityLeft
Type
MapData
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
shoulderEntityRight
Type
MapData
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
sleepTimer
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
xpNeededForNextLevel
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided