Импорт класса

Link to импорт-класса

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

Name: addExhaustion

Return Type: void

ZenScript
Copy
MCPlayerEntity.addExhaustion(exhaustion as float) as void
ПараметрТипDescription
Параметр
exhaustion
Тип
float
Description
No Description Provided

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
ПараметрТипDescription
Параметр
p_225609_1_
Тип
boolean
Description
No Description Provided

Name: getCurrentItem

Return Type: IItemStack

ZenScript
Copy
// MCPlayerEntity.getCurrentItem() as IItemStack

myMCPlayerEntity.getCurrentItem();

Name: getFoodLevel

Return Type: int

ZenScript
Copy
// MCPlayerEntity.getFoodLevel() as int

myMCPlayerEntity.getFoodLevel();

Name: getInventory

Return Type: PlayerInventory

ZenScript
Copy
// MCPlayerEntity.getInventory() as PlayerInventory

myMCPlayerEntity.getInventory();

Link to g-getinventoryitemstack

Name: getInventoryItemStack

Return Type: IItemStack

ZenScript
Copy
MCPlayerEntity.getInventoryItemStack(slotIndex as int) as IItemStack
ПараметрТипDescription
Параметр
slotIndex
Тип
int
Description
No Description Provided

Name: getLuck

Return Type: float

ZenScript
Copy
// MCPlayerEntity.getLuck() as float

myMCPlayerEntity.getLuck();

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();

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();

Name: getPortalCooldown

Return Type: int

ZenScript
Copy
// MCPlayerEntity.getPortalCooldown() as int

myMCPlayerEntity.getPortalCooldown();

Name: getSaturationLevel

Return Type: float

ZenScript
Copy
// MCPlayerEntity.getSaturationLevel() as float

myMCPlayerEntity.getSaturationLevel();

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
ПараметрТипDescription
Параметр
stack
Тип
IItemStack
Description
No Description Provided

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();

Name: isPushedByWater

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isPushedByWater() as boolean

myMCPlayerEntity.isPushedByWater();

Link to g-issecondaryuseactive

Name: isSecondaryUseActive

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isSecondaryUseActive() as boolean

myMCPlayerEntity.isSecondaryUseActive();

Name: isSpectator

Return Type: boolean

ZenScript
Copy
// MCPlayerEntity.isSpectator() as boolean

myMCPlayerEntity.isSpectator();

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();

Name: sendMessage

Return Type: void

ZenScript
Copy
MCPlayerEntity.sendMessage(text as MCTextComponent) as void
ПараметрТипDescription
Параметр
текст
Тип
Компонент MCTextcomponent
Description
No Description Provided

Name: sendStatusMessage

Return Type: void

ZenScript
Copy
MCPlayerEntity.sendStatusMessage(text as MCTextComponent, actionBar as boolean) as void
ПараметрТипDescription
Параметр
текст
Тип
Компонент MCTextcomponent
Description
No Description Provided
Параметр
actionBar
Тип
boolean
Description
No Description Provided

Name: setFoodLevel

Return Type: void

ZenScript
Copy
MCPlayerEntity.setFoodLevel(value as int) as void
ПараметрТипDescription
Параметр
value
Тип
int
Description
No Description Provided

Name: unlockRecipes

Return Type: void

ZenScript
Copy
MCPlayerEntity.unlockRecipes(p_193102_1_ as MCResourceLocation[]) as void
ПараметрТипDescription
Параметр
p_193102_1_
Тип
MCResourceLocation[]
Description
No Description Provided

Link to g-updatepersistentdata

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
ПараметрТипDescription
Параметр
data
Тип
MapData
Description
No Description Provided

Name: wakeUp

Return Type: void

ZenScript
Copy
// MCPlayerEntity.wakeUp() as void

myMCPlayerEntity.wakeUp();

Свойства

Link to свойства

НазваниеТипИмеет GetterИмеет SetterDescription
Название
fake
Тип
boolean
Имеет Getter
true
Имеет Setter
false
Description
No Description Provided
Название
foodLevel
Тип
int
Имеет Getter
true
Имеет Setter
true
Description
No Description Provided
Название
inventory
Тип
PlayerInventory
Имеет Getter
true
Имеет Setter
false
Description
No Description Provided
Название
name
Тип
Компонент MCTextcomponent
Имеет Getter
true
Имеет Setter
false
Description
No Description Provided
Название
saturationLevel
Тип
float
Имеет Getter
true
Имеет Setter
false
Description
No Description Provided