Player
Link to player
Импорт класса
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 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
Методы
Link to методы
Name: addItem
Return Type: boolean
ZenScript CopyPlayer.addItem(stack as ItemStack) as boolean
Параметр | Тип | Описание |
---|---|---|
Параметр stack | Тип ItemStack | Описание No Description Provided |
Name: attack
Return Type: void
ZenScript CopyPlayer.attack(entity as Entity) as void
Параметр | Тип | Описание |
---|---|---|
Параметр entity | Тип Entity | Описание No Description Provided |
Name: awardStat
Return Type: void
ZenScript CopyPlayer.awardStat(stat as ResourceLocation) as void
Параметр | Тип | Описание |
---|---|---|
Параметр stat | Тип ResourceLocation | Описание No Description Provided |
Name: awardStat
Return Type: void
ZenScript CopyPlayer.awardStat(stat as ResourceLocation, amount as int) as void
Параметр | Тип | Описание |
---|---|---|
Параметр stat | Тип ResourceLocation | Описание No Description Provided |
Параметр amount | Тип int | Описание No Description Provided |
Name: canEat
Return Type: boolean
ZenScript CopyPlayer.canEat(ignoreHunger as boolean) as boolean
Параметр | Тип | Описание |
---|---|---|
Параметр ignoreHunger | Тип boolean | Описание No Description Provided |
Name: canHarmPlayer
Return Type: boolean
ZenScript CopyPlayer.canHarmPlayer(player as Player) as boolean
Параметр | Тип | Описание |
---|---|---|
Параметр player | Тип Player | Описание No Description Provided |
Name: canUseGameMasterBlocks
Return Type: boolean
ZenScript Copy// Player.canUseGameMasterBlocks() as boolean
myPlayer.canUseGameMasterBlocks();
Name: causeFoodExhaustion
Return Type: void
ZenScript CopyPlayer.causeFoodExhaustion(exhaustion as float) as void
Параметр | Тип | Описание |
---|---|---|
Параметр exhaustion | Тип float | Описание No Description Provided |
Name: crit
Return Type: void
ZenScript CopyPlayer.crit(entity as Entity) as void
Параметр | Тип | Описание |
---|---|---|
Параметр entity | Тип Entity | Описание No Description Provided |
Name: disableShield
Return Type: void
ZenScript CopyPlayer.disableShield(usingAxe as boolean) as void
Параметр | Тип | Описание |
---|---|---|
Параметр usingAxe | Тип boolean | Описание No Description Provided |
Name: displayClientMessage
Return Type: void
ZenScript CopyPlayer.displayClientMessage(component as Component, actionBar as boolean) as void
Параметр | Тип | Описание |
---|---|---|
Параметр component | Тип Component | Описание No Description Provided |
Параметр actionBar | Тип boolean | Описание No Description Provided |
Name: drop
Return Type: ItemEntity
ZenScript CopyPlayer.drop(stack as ItemStack, traceItem as boolean) as ItemEntity
Параметр | Тип | Описание |
---|---|---|
Параметр stack | Тип ItemStack | Описание No Description Provided |
Параметр traceItem | Тип boolean | Описание No Description Provided |
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
Параметр | Тип | Описание |
---|---|---|
Параметр state | Тип BlockState | Описание No Description Provided |
Name: getEnchantmentSeed
Return Type: int
ZenScript Copy// Player.getEnchantmentSeed() as int
myPlayer.getEnchantmentSeed();
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
Return Type: void
ZenScript CopyPlayer.give(stack as IItemStack, slot as int) as void
Параметр | Тип | Описание | Optional | DefaultValue |
---|---|---|---|---|
Параметр stack | Тип IItemStack | Описание No Description Provided | Optional false | DefaultValue |
Параметр slot | Тип int | Описание No Description Provided | Optional true | DefaultValue -1 |
Name: giveExperienceLevels
Return Type: void
ZenScript CopyPlayer.giveExperienceLevels(levels as int) as void
Параметр | Тип | Описание |
---|---|---|
Параметр levels | Тип int | Описание No Description Provided |
Name: giveExperiencePoints
Return Type: void
ZenScript CopyPlayer.giveExperiencePoints(amount as int) as void
Параметр | Тип | Описание |
---|---|---|
Параметр amount | Тип int | Описание No Description Provided |
Name: hasCorrectToolForDrops
Return Type: boolean
ZenScript CopyPlayer.hasCorrectToolForDrops(state as BlockState) as boolean
Параметр | Тип | Описание |
---|---|---|
Параметр state | Тип BlockState | Описание No Description Provided |
Name: increaseScore
Return Type: void
ZenScript CopyPlayer.increaseScore(score as int) as void
Параметр | Тип | Описание |
---|---|---|
Параметр score | Тип int | Описание No Description Provided |
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
Return Type: void
ZenScript Copy// Player.jumpFromGround() as void
myPlayer.jumpFromGround();
Name: magicCrit
Return Type: void
ZenScript CopyPlayer.magicCrit(entity as Entity) as void
Параметр | Тип | Описание |
---|---|---|
Параметр entity | Тип Entity | Описание No Description Provided |
Name: mayBuild
Return Type: boolean
ZenScript Copy// Player.mayBuild() as boolean
myPlayer.mayBuild();
Name: playNotifySound
Return Type: void
ZenScript CopyPlayer.playNotifySound(event as SoundEvent, source as SoundSource, volume as float, pitch as float) as void
Параметр | Тип | Описание |
---|---|---|
Параметр event | Тип SoundEvent | Описание No Description Provided |
Параметр источник | Тип SoundSource | Описание No Description Provided |
Параметр volume | Тип float | Описание No Description Provided |
Параметр pitch | Тип float | Описание No Description Provided |
Name: respawn
Return Type: void
ZenScript Copy// Player.respawn() as void
myPlayer.respawn();
Name: sendMessage
Return Type: void
ZenScript CopyPlayer.sendMessage(text as Component) as void
Параметр | Тип | Описание |
---|---|---|
Параметр текст | Тип Component | Описание No Description Provided |
Name: setEntityOnShoulder
Return Type: boolean
ZenScript CopyPlayer.setEntityOnShoulder(entityData as MapData) as boolean
Параметр | Тип | Описание |
---|---|---|
Параметр entityData | Тип MapData | Описание No Description Provided |
Name: setMainArm
Return Type: void
ZenScript CopyPlayer.setMainArm(arm as HumanoidArm) as void
Параметр | Тип | Описание |
---|---|---|
Параметр arm | Тип HumanoidArm | Описание No Description Provided |
Name: setReducedDebugInfo
Return Type: void
ZenScript CopyPlayer.setReducedDebugInfo(reducedDebugInfo as boolean) as void
Параметр | Тип | Описание |
---|---|---|
Параметр reducedDebugInfo | Тип boolean | Описание No Description Provided |
Name: setScore
Return Type: void
ZenScript CopyPlayer.setScore(score as int) as void
Параметр | Тип | Описание |
---|---|---|
Параметр score | Тип int | Описание No Description Provided |
Name: stopSleeping
Return Type: void
ZenScript Copy// Player.stopSleeping() as void
myPlayer.stopSleeping();
Name: sweepAttack
Return Type: void
ZenScript Copy// Player.sweepAttack() as void
myPlayer.sweepAttack();
Свойства
Link to свойства
Название | Тип | Имеет Getter | Имеет Setter | Описание |
---|---|---|---|---|
Название abilities | Тип Abilities | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название canUseGameMasterBlocks | Тип boolean | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название cooldowns | Тип ItemCooldowns | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название currentItemAttackStrengthDelay | Тип float | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название enchantmentSeed | Тип int | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название foodData | Тип FoodData | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название inventory | Тип Inventory | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название isCreative | Тип boolean | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название isHurt | Тип boolean | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название isLocalPlayer | Тип boolean | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название isReducedDebugInfo | Тип boolean | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название isScoping | Тип boolean | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название isSecondaryUseActive | Тип boolean | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название isSleepingLongEnough | Тип boolean | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название luck | Тип float | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название mainArm | Тип HumanoidArm | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название mayBuild | Тип boolean | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название score | Тип int | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название shoulderEntityLeft | Тип MapData | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название shoulderEntityRight | Тип MapData | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название sleepTimer | Тип int | Имеет Getter true | Имеет Setter false | Описание No Description Provided |
Название xpNeededForNextLevel | Тип int | Имеет Getter true | Имеет Setter false | Описание No Description Provided |