MCPlayerEntity

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

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

Methods

addExhaustion

Return Type: void

ZenScript
Copy
MCPlayerEntity.addExhaustion(exhaustion as float) as void
ParameterTypeDescription
exhaustionfloatNo Description Provided
canUseCommandBlock

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.canUseCommandBlock() as boolean

myMCPlayerEntity.canUseCommandBlock();
drop

Return Type: boolean

ZenScript
Copy
MCPlayerEntity.drop(p_225609_1_ as boolean) as boolean
ParameterTypeDescription
p_225609_1_booleanNo Description Provided
getCurrentItem

Return Type: IItemStack

ZenScript
Copy
// MCPlayerEntity.getCurrentItem() as IItemStack

myMCPlayerEntity.getCurrentItem();
getFoodLevel

Return Type: int

ZenScript
Copy
// MCPlayerEntity.getFoodLevel() as int

myMCPlayerEntity.getFoodLevel();
getInventory

Return Type: PlayerInventory

ZenScript
Copy
// MCPlayerEntity.getInventory() as PlayerInventory

myMCPlayerEntity.getInventory();
getInventoryItemStack

Return Type: IItemStack

ZenScript
Copy
MCPlayerEntity.getInventoryItemStack(slotIndex as int) as IItemStack
ParameterTypeDescription
slotIndexintNo Description Provided
getLuck

Return Type: float

ZenScript
Copy
// MCPlayerEntity.getLuck() as float

myMCPlayerEntity.getLuck();
getMaxInPortalTime

Return Type: int

ZenScript
Copy
// MCPlayerEntity.getMaxInPortalTime() as int

myMCPlayerEntity.getMaxInPortalTime();
getName

Return Type: MCTextComponent

ZenScript
Copy
// MCPlayerEntity.getName() as MCTextComponent

myMCPlayerEntity.getName();
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();
getPortalCooldown

Return Type: int

ZenScript
Copy
// MCPlayerEntity.getPortalCooldown() as int

myMCPlayerEntity.getPortalCooldown();
getSaturationLevel

Return Type: float

ZenScript
Copy
// MCPlayerEntity.getSaturationLevel() as float

myMCPlayerEntity.getSaturationLevel();
getSleepTimer

Return Type: int

ZenScript
Copy
// MCPlayerEntity.getSleepTimer() as int

myMCPlayerEntity.getSleepTimer();
give

Return Type: void

ZenScript
Copy
MCPlayerEntity.give(stack as IItemStack) as void
ParameterTypeDescription
stackIItemStackNo Description Provided
isCreative

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isCreative() as boolean

myMCPlayerEntity.isCreative();
isFake

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isFake() as boolean

myMCPlayerEntity.isFake();
isPushedByWater

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isPushedByWater() as boolean

myMCPlayerEntity.isPushedByWater();
isSecondaryUseActive

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isSecondaryUseActive() as boolean

myMCPlayerEntity.isSecondaryUseActive();
isSpectator

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isSpectator() as boolean

myMCPlayerEntity.isSpectator();
isSwimming

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isSwimming() as boolean

myMCPlayerEntity.isSwimming();
isUser

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isUser() as boolean

myMCPlayerEntity.isUser();
needFood

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.needFood() as boolean

myMCPlayerEntity.needFood();
sendMessage

Return Type: void

ZenScript
Copy
MCPlayerEntity.sendMessage(text as MCTextComponent) as void
ParameterTypeDescription
tekstKomponent MCTextNo Description Provided
sendStatusMessage

Return Type: void

ZenScript
Copy
MCPlayerEntity.sendStatusMessage(text as MCTextComponent, actionBar as boolean) as void
ParameterTypeDescription
tekstKomponent MCTextNo Description Provided
actionBarbooleanNo Description Provided
setFoodLevel

Return Type: void

ZenScript
Copy
MCPlayerEntity.setFoodLevel(value as int) as void
ParameterTypeDescription
valueintNo Description Provided
unlockRecipes

Return Type: void

ZenScript
Copy
MCPlayerEntity.unlockRecipes(p_193102_1_ as MCResourceLocation[]) as void
ParameterTypeDescription
p_193102_1_MCResourceLocation[]No Description Provided
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
dataMapDataNo Description Provided
wakeUp

Return Type: void

ZenScript
Copy
// MCPlayerEntity.wakeUp() as void

myMCPlayerEntity.wakeUp();

Properties

NameTypeHas GetterHas SetterDescription
fakebooleantruefalseNo Description Provided
foodLevelinttruetrueNo Description Provided
inventoryPlayerInventorytruefalseNo Description Provided
nameKomponent MCTexttruefalseNo Description Provided
saturationLevelfloattruefalseNo Description Provided