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.player.MCPlayerEntity;

Extending MCLivingEntity

Link to extending-mclivingentity

MCPlayerEntity extends MCLivingEntity. That means all methods available in MCLivingEntity are also available in MCPlayerEntity

Link to g-

Name: addExhaustion

Return Type: void

ZenScript
Copy
MCPlayerEntity.addExhaustion(exhaustion as float) as void
ParameterTypeDescription
Parameter
exhaustion
Type
float
Description
No Description Provided

Link to g--1

Name: addExperienceLevels

Return Type: void

ZenScript
Copy
MCPlayerEntity.addExperienceLevels(levels as int) as void
ParameterTypeDescription
Parameter
levels
Type
int
Description
No Description Provided

Link to g--2

Name: canUseCommandBlock

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.canUseCommandBlock() as boolean

myMCPlayerEntity.canUseCommandBlock();

Name: drop

Return Type: boolean

ZenScript
Copy
MCPlayerEntity.drop(p_225609_1_ as boolean) as boolean
ParameterTypeDescription
Parameter
p_225609_1_
Type
boolean
Description
No Description Provided

Link to g--4

Name: getCurrentItem

Return Type: IItemStack

ZenScript
Copy
// MCPlayerEntity.getCurrentItem() as IItemStack

myMCPlayerEntity.getCurrentItem();

Link to g--5

Name: getExperience

Return Type: float

ZenScript
Copy
// MCPlayerEntity.getExperience() as float

myMCPlayerEntity.getExperience();

Link to g--6

Name: getExperienceLevel

Return Type: int

ZenScript
Copy
// MCPlayerEntity.getExperienceLevel() as int

myMCPlayerEntity.getExperienceLevel();

Link to g--7

Name: getExperienceTotal

Return Type: int

ZenScript
Copy
// MCPlayerEntity.getExperienceTotal() as int

myMCPlayerEntity.getExperienceTotal();

Link to g--8

Name: getFoodLevel

Return Type: int

ZenScript
Copy
// MCPlayerEntity.getFoodLevel() as int

myMCPlayerEntity.getFoodLevel();

Link to g--9

Name: getHeldItem

Return Type: IItemStack

ZenScript
Copy
MCPlayerEntity.getHeldItem(hand as MCHand) as IItemStack
ParameterTypeDescription
Parameter
hand
Type
MCHand
Description
No Description Provided

Link to g--10

Name: getInventory

Return Type: PlayerInventory

ZenScript
Copy
// MCPlayerEntity.getInventory() as PlayerInventory

myMCPlayerEntity.getInventory();

Link to g--11

Name: getInventoryItemStack

Return Type: IItemStack

ZenScript
Copy
MCPlayerEntity.getInventoryItemStack(slotIndex as int) as IItemStack
ParameterTypeDescription
Parameter
slotIndex
Type
int
Description
No Description Provided

Name: getLuck

Return Type: float

ZenScript
Copy
// MCPlayerEntity.getLuck() as float

myMCPlayerEntity.getLuck();

Link to g--13

Name: getMaxInPortalTime

Return Type: int

ZenScript
Copy
// MCPlayerEntity.getMaxInPortalTime() as int

myMCPlayerEntity.getMaxInPortalTime();

Name: getName

Return Type: MCTextComponent

ZenScript
Copy
// MCPlayerEntity.getName() as MCTextComponent

myMCPlayerEntity.getName();

Link to g--15

Name: getPersistentData

Gets the persisted NBT tag that is saved between deaths. Many mods use this to keep track of if they have given the player an item or not.

Return Type: MapData

ZenScript
Copy
// MCPlayerEntity.getPersistentData() as MapData

myMCPlayerEntity.getPersistentData();

Link to g--16

Name: getPortalCooldown

Return Type: int

ZenScript
Copy
// MCPlayerEntity.getPortalCooldown() as int

myMCPlayerEntity.getPortalCooldown();

Link to g--17

Name: getSaturationLevel

Return Type: float

ZenScript
Copy
// MCPlayerEntity.getSaturationLevel() as float

myMCPlayerEntity.getSaturationLevel();

Link to g--18

Name: getSleepTimer

Return Type: int

ZenScript
Copy
// MCPlayerEntity.getSleepTimer() as int

myMCPlayerEntity.getSleepTimer();

Name: give

Return Type: void

ZenScript
Copy
MCPlayerEntity.give(stack as IItemStack) as void
ParameterTypeDescription
Parameter
stack
Type
IItemStack
Description
No Description Provided

Link to g--20

Name: giveExperiencePoints

Return Type: void

ZenScript
Copy
MCPlayerEntity.giveExperiencePoints(experience as int) as void
ParameterTypeDescription
Parameter
experience
Type
int
Description
No Description Provided

Link to g--21

Name: isCreative

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isCreative() as boolean

myMCPlayerEntity.isCreative();

Name: isFake

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isFake() as boolean

myMCPlayerEntity.isFake();

Link to g--23

Name: isPushedByWater

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isPushedByWater() as boolean

myMCPlayerEntity.isPushedByWater();

Link to g--24

Name: isSecondaryUseActive

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isSecondaryUseActive() as boolean

myMCPlayerEntity.isSecondaryUseActive();

Link to g--25

Name: isSpectator

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isSpectator() as boolean

myMCPlayerEntity.isSpectator();

Link to g--26

Name: isSwimming

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isSwimming() as boolean

myMCPlayerEntity.isSwimming();

Name: isUser

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isUser() as boolean

myMCPlayerEntity.isUser();

Name: needFood

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.needFood() as boolean

myMCPlayerEntity.needFood();

Link to g--29

Name: sendMessage

Return Type: void

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

Link to g--30

Name: sendStatusMessage

Return Type: void

ZenScript
Copy
MCPlayerEntity.sendStatusMessage(text as MCTextComponent, actionBar as boolean) as void
ParameterTypeDescription
Parameter
texto
Type
MCTextComponent
Description
No Description Provided
Parameter
actionBar
Type
boolean
Description
No Description Provided

Link to g--31

Name: setFoodLevel

Return Type: void

ZenScript
Copy
MCPlayerEntity.setFoodLevel(value as int) as void
ParameterTypeDescription
Parameter
value
Type
int
Description
No Description Provided

Name: swing

Return Type: void

ZenScript
Copy
MCPlayerEntity.swing(hand as MCHand, updateSelf as boolean) as void
ParameterTypeDescription
Parameter
hand
Type
MCHand
Description
No Description Provided
Parameter
updateSelf
Type
boolean
Description
No Description Provided

Link to g--33

Name: unlockRecipes

Return Type: void

ZenScript
Copy
MCPlayerEntity.unlockRecipes(p_193102_1_ as MCResourceLocation[]) as void
ParameterTypeDescription
Parameter
p_193102_1_
Type
MCResourceLocation[]
Description
No Description Provided

Link to g--34

Name: updatePersistentData

Updates the player's persisted data that is saved between deaths.

Return Type: void

ZenScript
Copy
MCPlayerEntity.updatePersistentData(data as MapData) as void
ParameterTypeDescription
Parameter
data
Type
MapData
Description
No Description Provided

Name: wakeUp

Return Type: void

ZenScript
Copy
// MCPlayerEntity.wakeUp() as void

myMCPlayerEntity.wakeUp();
NombreTypeHas GetterHas SetterDescription
Nombre
experience
Type
float
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
experienceLevel
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
experienceTotal
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
fake
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
foodLevel
Type
int
Has Getter
true
Has Setter
true
Description
No Description Provided
Nombre
inventory
Type
PlayerInventory
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
name
Type
MCTextComponent
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
saturationLevel
Type
float
Has Getter
true
Has Setter
false
Description
No Description Provided