Player
Link to player
Importare la Classe
Link to importare-la-classe
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 Copyimport 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
Metodi
Link to metodi
Name: addItem
Return Type: boolean
ZenScript CopyPlayer.addItem(stack as ItemStack) as boolean
Parametro | Tipo |
---|---|
Parametro stack | Tipo ItemStack |
Name: awardStat
ZenScript CopyPlayer.awardStat(stat as ResourceLocation)
Parametro | Tipo |
---|---|
Parametro stat | Tipo ResourceLocation |
Name: awardStat
ZenScript CopyPlayer.awardStat(stat as ResourceLocation, amount as int)
Parametro | Tipo |
---|---|
Parametro stat | Tipo ResourceLocation |
Parametro amount | Tipo int |
Name: canEat
Return Type: boolean
ZenScript CopyPlayer.canEat(ignoreHunger as boolean) as boolean
Parametro | Tipo |
---|---|
Parametro ignoreHunger | Tipo boolean |
Name: canHarmPlayer
Return Type: boolean
ZenScript CopyPlayer.canHarmPlayer(player as Player) as boolean
Parametro | Tipo |
---|---|
Parametro player | Tipo Player |
Name: canUseGameMasterBlocks
Return Type: boolean
ZenScript Copy// Player.canUseGameMasterBlocks() as boolean
myPlayer.canUseGameMasterBlocks();
Name: causeFoodExhaustion
ZenScript CopyPlayer.causeFoodExhaustion(exhaustion as float)
Parametro | Tipo |
---|---|
Parametro exhaustion | Tipo float |
Name: disableShield
ZenScript CopyPlayer.disableShield(usingAxe as boolean)
Parametro | Tipo |
---|---|
Parametro usingAxe | Tipo boolean |
Name: displayClientMessage
ZenScript CopyPlayer.displayClientMessage(component as Component, actionBar as boolean)
Parametro | Tipo |
---|---|
Parametro component | Tipo Component |
Parametro actionBar | Tipo boolean |
Name: drop
Return Type: ItemEntity?
ZenScript CopyPlayer.drop(stack as ItemStack, traceItem as boolean) as ItemEntity?
Parametro | Tipo |
---|---|
Parametro stack | Tipo ItemStack |
Parametro traceItem | Tipo boolean |
Name: getAbilities
Return Type: Abilities
ZenScript Copy// Player.getAbilities() as Abilities
myPlayer.getAbilities();
Name: getCooldowns
Return Type: ItemCooldowns
ZenScript Copy// Player.getCooldowns() as ItemCooldowns
myPlayer.getCooldowns();
Name: getCurrentItemAttackStrengthDelay
Return Type: float
ZenScript Copy// Player.getCurrentItemAttackStrengthDelay() as float
myPlayer.getCurrentItemAttackStrengthDelay();
Name: getDestroySpeed
Return Type: float
ZenScript CopyPlayer.getDestroySpeed(state as BlockState) as float
Parametro | Tipo |
---|---|
Parametro state | Tipo BlockState |
Name: getEnchantmentSeed
Return Type: int
ZenScript Copy// Player.getEnchantmentSeed() as int
myPlayer.getEnchantmentSeed();
Name: getExperienceLevel
Return Type: int
ZenScript Copy// Player.getExperienceLevel() as int
myPlayer.getExperienceLevel();
Name: getFoodData
Return Type: FoodData
ZenScript Copy// Player.getFoodData() as FoodData
myPlayer.getFoodData();
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();
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();
Name: getShoulderEntityLeft
Return Type: MapData
ZenScript Copy// Player.getShoulderEntityLeft() as MapData
myPlayer.getShoulderEntityLeft();
Name: getShoulderEntityRight
Return Type: MapData
ZenScript Copy// Player.getShoulderEntityRight() as MapData
myPlayer.getShoulderEntityRight();
Name: getSleepTimer
Return Type: int
ZenScript Copy// Player.getSleepTimer() as int
myPlayer.getSleepTimer();
Name: getXpNeededForNextLevel
Return Type: int
ZenScript Copy// Player.getXpNeededForNextLevel() as int
myPlayer.getXpNeededForNextLevel();
Name: give
ZenScript CopyPlayer.give(stack as IItemStack, slot as int)
Parametro | Tipo | Optional | Default Value |
---|---|---|---|
Parametro stack | Tipo IItemStack | Optional no | Default Value |
Parametro slot | Tipo int | Optional sì | Default Value -1 |
Name: giveExperienceLevels
ZenScript CopyPlayer.giveExperienceLevels(levels as int)
Parametro | Tipo |
---|---|
Parametro levels | Tipo int |
Name: giveExperiencePoints
ZenScript CopyPlayer.giveExperiencePoints(amount as int)
Parametro | Tipo |
---|---|
Parametro amount | Tipo int |
Name: hasCorrectToolForDrops
Return Type: boolean
ZenScript CopyPlayer.hasCorrectToolForDrops(state as BlockState) as boolean
Parametro | Tipo |
---|---|
Parametro state | Tipo BlockState |
Name: increaseScore
ZenScript CopyPlayer.increaseScore(score as int)
Parametro | Tipo |
---|---|
Parametro score | Tipo int |
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();
Name: isLocalPlayer
Return Type: boolean
ZenScript Copy// Player.isLocalPlayer() as boolean
myPlayer.isLocalPlayer();
Name: isReducedDebugInfo
Return Type: boolean
ZenScript Copy// Player.isReducedDebugInfo() as boolean
myPlayer.isReducedDebugInfo();
Name: isScoping
Return Type: boolean
ZenScript Copy// Player.isScoping() as boolean
myPlayer.isScoping();
Name: isSecondaryUseActive
Return Type: boolean
ZenScript Copy// Player.isSecondaryUseActive() as boolean
myPlayer.isSecondaryUseActive();
Name: isSleepingLongEnough
Return Type: boolean
ZenScript Copy// Player.isSleepingLongEnough() as boolean
myPlayer.isSleepingLongEnough();
Name: jumpFromGround
ZenScript Copy// Player.jumpFromGround()
myPlayer.jumpFromGround();
Name: magicCrit
ZenScript CopyPlayer.magicCrit(entity as Entity)
Parametro | Tipo |
---|---|
Parametro entity | Tipo Entity |
Name: mayBuild
Return Type: boolean
ZenScript Copy// Player.mayBuild() as boolean
myPlayer.mayBuild();
Name: playNotifySound
ZenScript CopyPlayer.playNotifySound(event as SoundEvent, source as SoundSource, volume as float, pitch as float)
Parametro | Tipo |
---|---|
Parametro event | Tipo SoundEvent |
Parametro sorgente | Tipo SoundSource |
Parametro volume | Tipo float |
Parametro pitch | Tipo float |
Name: respawn
ZenScript Copy// Player.respawn()
myPlayer.respawn();
Name: sendMessage
ZenScript CopyPlayer.sendMessage(text as Component)
Parametro | Tipo |
---|---|
Parametro testo | Tipo Component |
Name: setEntityOnShoulder
Return Type: boolean
ZenScript CopyPlayer.setEntityOnShoulder(entityData as MapData) as boolean
Parametro | Tipo |
---|---|
Parametro entityData | Tipo MapData |
Name: setExperienceLevel
ZenScript CopyPlayer.setExperienceLevel(level as int)
Parametro | Tipo |
---|---|
Parametro level | Tipo int |
Name: setMainArm
ZenScript CopyPlayer.setMainArm(arm as HumanoidArm)
Parametro | Tipo |
---|---|
Parametro arm | Tipo HumanoidArm |
Name: setReducedDebugInfo
ZenScript CopyPlayer.setReducedDebugInfo(reducedDebugInfo as boolean)
Parametro | Tipo |
---|---|
Parametro reducedDebugInfo | Tipo boolean |
Name: setScore
ZenScript CopyPlayer.setScore(score as int)
Parametro | Tipo |
---|---|
Parametro score | Tipo int |
Name: stopSleeping
ZenScript Copy// Player.stopSleeping()
myPlayer.stopSleeping();
Name: sweepAttack
ZenScript Copy// Player.sweepAttack()
myPlayer.sweepAttack();
Proprietà
Link to proprietà
Nome | Tipo | Ha Getter | Ha Setter |
---|---|---|---|
Nome abilities | Tipo Abilities | Ha Getter sì | Ha Setter no |
Nome canUseGameMasterBlocks | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome cooldowns | Tipo ItemCooldowns | Ha Getter sì | Ha Setter no |
Nome currentItemAttackStrengthDelay | Tipo float | Ha Getter sì | Ha Setter no |
Nome enchantmentSeed | Tipo int | Ha Getter sì | Ha Setter no |
Nome experienceLevel | Tipo int | Ha Getter sì | Ha Setter sì |
Nome foodData | Tipo FoodData | Ha Getter sì | Ha Setter no |
Nome inventory | Tipo Inventory | Ha Getter sì | Ha Setter no |
Nome isCreative | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome isHurt | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome isLocalPlayer | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome isReducedDebugInfo | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome isScoping | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome isSecondaryUseActive | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome isSleepingLongEnough | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome luck | Tipo float | Ha Getter sì | Ha Setter no |
Nome mainArm | Tipo HumanoidArm | Ha Getter sì | Ha Setter no |
Nome mayBuild | Tipo boolean | Ha Getter sì | Ha Setter no |
Nome score | Tipo int | Ha Getter sì | Ha Setter no |
Nome shoulderEntityLeft | Tipo MapData | Ha Getter sì | Ha Setter no |
Nome shoulderEntityRight | Tipo MapData | Ha Getter sì | Ha Setter no |
Nome sleepTimer | Tipo int | Ha Getter sì | Ha Setter no |
Nome xpNeededForNextLevel | Tipo int | Ha Getter sì | Ha Setter no |