Documentation
Advancement
Represents an advancement.
Attributes:
Name | Type | Description |
---|---|---|
id |
Identifier
|
The unique identifier of the advancement. |
requirements |
list[list[str]]
|
The requirements needed to unlock the advancement. |
text |
Text
|
The text description or details of the advancement. |
parent |
Advancement
|
The parent advancement, if any, that must be completed before unlocking this advancement. |
display |
AdvancementDisplay
|
The display settings and visuals for the advancement. |
rewards |
AdvancementRewards
|
The rewards associated with completing the advancement. |
AdvancementDisplay
Represents the display settings and visuals for an advancement.
Attributes:
Name | Type | Description |
---|---|---|
title |
Text
|
The title of the advancement display. |
description |
Text
|
The description of the advancement display. |
hidden |
bool
|
Specifies whether the advancement is hidden or not. |
frame |
AdvancementFrame
|
The frame type for the advancement display. |
showToast |
bool
|
Specifies whether to show a toast notification for the advancement. |
icon |
ItemStack
|
The icon associated with the advancement display. |
AdvancementRewards
Represents the rewards associated with completing an advancement.
Attributes:
Name | Type | Description |
---|---|---|
experience |
int
|
The amount of experience rewarded for completing the advancement. |
loot |
list[Identifier]
|
The list of identifiers for loot rewarded upon completion. |
recipes |
list[Identifier]
|
The list of identifiers for recipes unlocked upon completion. |
Block
__init__(block)
Initializes a new Block object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block |
Blocks
|
The block object representing the block. |
required |
BlockPos
Represents a position in the world.
Attributes:
Name | Type | Description |
---|---|---|
x |
int
|
The x-coordinate of the position. |
y |
int
|
The y-coordinate of the position. |
z |
int
|
The z-coordinate of the position. |
__init__(x, y, z)
Initializes a new BlockPos object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Number
|
The x-coordinate of the position. |
required |
y |
Number
|
The y-coordinate of the position. |
required |
z |
Number
|
The z-coordinate of the position. |
required |
BlockState
The BlockState class represents the state of a block in Minecraft.
Attributes:
Name | Type | Description |
---|---|---|
block |
Block
|
The block associated with this state. |
Entity
__init__(entity, world)
Initializes a new entity with the specified entity type and world.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
Entities
|
The type of entity. |
required |
world |
World
|
The world the entity belongs to. |
required |
addVelocity(velocity)
Adds velocity to the entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
velocity |
Vec3d
|
The velocity to add to the entity. |
required |
canFreeze()
Checks if the entity can freeze.
Returns:
Type | Description |
---|---|
bool
|
True if the entity can freeze, False otherwise. |
canUsePortals()
Checks if the entity can use portals.
Returns:
Type | Description |
---|---|
bool
|
True if the entity can use portals, False otherwise. |
collidesWith(entity)
Checks if the entity collides with another entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
Entity
|
The entity to check collision with. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the entity collides with the specified entity, False otherwise. |
damage(damageSource, amount)
Damages the entity by the specified amount using the given damage source.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
damageSource |
DamageSources
|
The source of the damage. |
required |
amount |
Number
|
The amount of damage to inflict. |
required |
dismountVehicle()
Dismounts the entity from its current vehicle.
distanceTo(entity)
Calculates the distance to another entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
Entity
|
The entity to calculate the distance to. |
required |
Returns:
Type | Description |
---|---|
float
|
The distance to the specified entity. |
extinguish()
Extinguishes the entity.
extinguishWithSound()
Extinguishes the entity with a sound effect.
getArmorItems()
Returns a list of armor items worn by the entity.
Returns:
Type | Description |
---|---|
list[ItemStack]
|
A list of ItemStack objects representing the armor items. |
getBlockPos()
Returns the block position of the entity.
Returns:
Type | Description |
---|---|
BlockPos
|
The BlockPos object representing the block position. |
getCommandTags()
Returns a list of command tags associated with the entity.
Returns:
Type | Description |
---|---|
list[str]
|
A list of strings representing the command tags. |
getCustomName()
Returns the custom name of the entity.
Returns:
Type | Description |
---|---|
str
|
The custom name of the entity as a string. |
getDisplayName()
Returns the display name of the entity.
Returns:
Type | Description |
---|---|
str
|
The display name of the entity as a string. |
getHandItems()
Returns a list of items held in the entity's hands.
Returns:
Type | Description |
---|---|
list[ItemStack]
|
A list of ItemStack objects representing the held items. |
getName()
Returns the name of the entity.
Returns:
Type | Description |
---|---|
str
|
The name of the entity as a string. |
getPosition()
Returns the position of the entity.
Returns:
Type | Description |
---|---|
Vec3d
|
The position of the entity as a Vec3d object. |
getVehicle()
Returns the vehicle that the entity is riding.
Returns:
Type | Description |
---|---|
Entity
|
The vehicle entity that the entity is riding, or None if not riding any vehicle. |
getVelocity()
Returns the velocity of the entity.
Returns:
Type | Description |
---|---|
Vec3d
|
The velocity of the entity as a Vec3d object. |
getX()
Returns the X-coordinate of the entity's position.
Returns:
Type | Description |
---|---|
float
|
The X-coordinate of the entity's position as a float. |
getY()
Returns the Y-coordinate of the entity's position.
Returns:
Type | Description |
---|---|
float
|
The Y-coordinate of the entity's position as a float. |
getZ()
Returns the Z-coordinate of the entity's position.
Returns:
Type | Description |
---|---|
float
|
The Z-coordinate of the entity's position as a float. |
hasCustomName()
Checks if the entity has a custom name.
Returns:
Type | Description |
---|---|
bool
|
True if the entity has a custom name, False otherwise. |
hasNoGravity()
Checks if the entity has no gravity.
Returns:
Type | Description |
---|---|
bool
|
True if the entity has no gravity, False otherwise. |
hasPassenger(entity)
Checks if the entity has the specified entity as a passenger.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
Entity
|
The entity to check for as a passenger. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the entity has the specified entity as a passenger, False otherwise. |
hasPassengers()
Checks if the entity has any passengers.
Returns:
Type | Description |
---|---|
bool
|
True if the entity has passengers, False otherwise. |
hasPermissionLevel(level)
Checks if the entity has the specified permission level.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
level |
Number
|
The permission level to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the entity has the specified permission level, False otherwise. |
hasPortalCooldown()
Checks if the entity has a portal cooldown.
Returns:
Type | Description |
---|---|
bool
|
True if the entity has a portal cooldown, False otherwise. |
hasVehicle()
Checks if the entity is riding a vehicle.
Returns:
Type | Description |
---|---|
bool
|
True if the entity is riding a vehicle, False otherwise. |
isAlive()
Checks if the entity is alive.
Returns:
Type | Description |
---|---|
bool
|
True if the entity is alive, False otherwise. |
isCollidable()
Checks if the entity is collidable.
Returns:
Type | Description |
---|---|
bool
|
True if the entity is collidable, False otherwise. |
isCrawling()
Checks if the entity is crawling.
Returns:
Type | Description |
---|---|
bool
|
True if the entity is crawling, False otherwise. |
isCustomNameVisible()
Checks if the entity's custom name is visible.
Returns:
Type | Description |
---|---|
bool
|
True if the entity's custom name is visible, False otherwise. |
isDead()
Checks if the entity is dead.
Returns:
Type | Description |
---|---|
bool
|
True if the entity is dead, False otherwise. |
isInLava()
Checks if the entity is in lava.
Returns:
Type | Description |
---|---|
bool
|
True if the entity is in lava, False otherwise. |
isInRain()
Checks if the entity is in rain.
Returns:
Type | Description |
---|---|
bool
|
True if the entity is in rain, False otherwise. |
isInsidePortal()
Checks if the entity is inside a portal.
Returns:
Type | Description |
---|---|
bool
|
True if the entity is inside a portal, False otherwise. |
isInsideWater()
Checks if the entity is inside water.
Returns:
Type | Description |
---|---|
bool
|
True if the entity is inside water, False otherwise. |
isOnGround()
Checks if the entity is on the ground.
Returns:
Type | Description |
---|---|
bool
|
True if the entity is on the ground, False otherwise. |
isSpectator()
Checks if the entity is a spectator.
Returns:
Type | Description |
---|---|
bool
|
True if the entity is a spectator, False otherwise. |
isSubmergedInWater()
Checks if the entity is submerged in water.
Returns:
Type | Description |
---|---|
bool
|
True if the entity is submerged in water, False otherwise. |
isVisible()
Checks if the entity is visible.
Returns:
Type | Description |
---|---|
bool
|
True if the entity is visible, False otherwise. |
lookAt(x, y, z)
Sets the entity's rotation to face the specified position.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
float
|
The X-coordinate of the target position. |
required |
y |
float
|
The Y-coordinate of the target position. |
required |
z |
float
|
The Z-coordinate of the target position. |
required |
removeAllPassengers()
Removes all passengers from the entity.
removePassenger(entity)
Removes the specified entity from the entity's passengers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
Entity
|
The entity to remove as a passenger. |
required |
removePermissionLevel(level)
Removes the specified permission level from the entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
level |
Number
|
The permission level to remove. |
required |
ride(entity)
Rides the specified entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
Entity
|
The entity to ride. |
required |
setCustomName(customName)
Sets the custom name of the entity using a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
customName |
str
|
The custom name to set. |
required |
setCustomNameVisible(visible)
Sets whether the custom name of the entity is visible.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
visible |
bool
|
True to make the custom name visible, False to hide it. |
required |
setGlowing(glowing)
Sets whether the entity is glowing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
glowing |
bool
|
True to make the entity glow, False otherwise. |
required |
setInvisible(invisible)
Sets whether the entity is invisible.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
invisible |
bool
|
True to make the entity invisible, False otherwise. |
required |
setInvulnerable(invulnerable)
Sets whether the entity is invulnerable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
invulnerable |
bool
|
True to make the entity invulnerable, False otherwise. |
required |
setMotion(motion)
Sets the motion of the entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
motion |
Vec3d
|
The new motion to set for the entity. |
required |
setNoGravity(noGravity)
Sets whether the entity has gravity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
noGravity |
bool
|
True to disable gravity for the entity, False otherwise. |
required |
setPosition(x, y, z)
Sets the position of the entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
float
|
The X-coordinate of the new position. |
required |
y |
float
|
The Y-coordinate of the new position. |
required |
z |
float
|
The Z-coordinate of the new position. |
required |
setSilent(silent)
Sets whether the entity is silent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
silent |
bool
|
True to make the entity silent, False otherwise. |
required |
setSneaking(sneaking)
Sets whether the entity is sneaking.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sneaking |
bool
|
True to make the entity sneak, False otherwise. |
required |
setSprinting(sprinting)
Sets whether the entity is sprinting.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sprinting |
bool
|
True to make the entity sprint, False otherwise. |
required |
startRiding(entity)
Starts riding the specified entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
Entity
|
The entity to start riding. |
required |
stopRiding()
Stops riding any entity the entity is currently riding.
teleport(position)
Teleports the entity to the specified position.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
position |
Vec3d
|
The position to teleport the entity to. |
required |
LivingEntity
Bases: Entity
Represents a living entity. Inherits from Entity.
addStatusEffect(effect, duration, amplifier, visible)
Adds a status effect to the living entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
effect |
StatusEffects
|
The status effect to add. |
required |
duration |
Number
|
The duration of the effect. |
required |
amplifier |
Number
|
The amplifier level of the effect. |
required |
visible |
bool
|
Whether the effect is visible. |
required |
canBreatheInWater()
Checks if the living entity can breathe underwater.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity can breathe in water, False otherwise. |
canHaveStatusEffect(effect)
Checks if the living entity can have the specified status effect.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
effect |
StatusEffects
|
The status effect to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity can have the effect, False otherwise. |
canSee(entity)
Checks if the living entity can see the specified entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
Entity
|
The entity to check visibility. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity can see the other entity, False otherwise. |
canTakeDamage()
Checks if the living entity can take damage.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity can take damage, False otherwise. |
clearStatusEffects()
Clears all status effects from the living entity.
damageArmor(damageSource, amount)
Damages the entity's armor by the specified amount.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
damageSource |
DamageSources
|
The source of the damage. |
required |
amount |
Number
|
The amount of damage to apply. |
required |
damageHelmet(damageSource, amount)
Damages the entity's helmet by the specified amount.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
damageSource |
DamageSources
|
The source of the damage. |
required |
amount |
Number
|
The amount of damage to apply. |
required |
damageShield(amount)
Damages the entity's shield by the specified amount.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amount |
Number
|
The amount of damage to apply. |
required |
eatFood(stack)
Makes the living entity eat the specified food item stack.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stack |
ItemStack
|
The food item stack to eat. |
required |
getAbsorptionAmount()
Returns the absorption amount of the living entity.
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The absorption amount. |
getActiveHand()
Returns the active hand of the living entity.
Returns:
Name | Type | Description |
---|---|---|
Hand |
Hand
|
The active hand. |
getActiveItem()
Returns the item stack in the entity's active hand.
Returns:
Name | Type | Description |
---|---|---|
ItemStack |
ItemStack
|
The active item stack. |
getArmor()
Returns the armor value of the living entity.
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The armor value. |
getAttacker()
Returns the entity that attacked this living entity.
Returns:
Name | Type | Description |
---|---|---|
LivingEntity |
LivingEntity
|
The attacking entity. |
getAttacking()
Returns the entity that this living entity is currently attacking.
Returns:
Name | Type | Description |
---|---|---|
LivingEntity |
LivingEntity
|
The attacking entity. |
getHealth()
Returns the current health of the living entity.
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The current health. |
getMainArm()
Returns the main arm of the living entity.
Returns:
Name | Type | Description |
---|---|---|
Arm |
Arm
|
The main arm. |
getMainHandStack()
Returns the item stack in the entity's main hand.
Returns:
Name | Type | Description |
---|---|---|
ItemStack |
ItemStack
|
The main hand item stack. |
getMaxHealth()
Returns the maximum health of the living entity.
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The maximum health. |
getMovementSpeed()
Returns the movement speed of the living entity.
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The movement speed. |
getScaleFactor()
Returns the scale factor of the living entity.
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The scale factor. |
getStackInHand(hand)
Returns the item stack in the specified hand.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hand |
Hand
|
The hand to get the item stack from. |
required |
Returns:
Name | Type | Description |
---|---|---|
ItemStack |
ItemStack
|
The item stack in the hand. |
getStatusEffect(effect)
Returns the status effect instance of the specified effect.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
effect |
StatusEffects
|
The status effect to retrieve. |
required |
Returns:
Name | Type | Description |
---|---|---|
StatusEffectInstance |
StatusEffectInstance
|
The status effect instance. |
getStatusEffects()
Returns a list of all status effects applied to the living entity.
Returns:
Type | Description |
---|---|
list[StatusEffectInstance]
|
list[StatusEffectInstance]: The list of status effect instances. |
getStuckArrowCount()
Returns the number of arrows stuck in the living entity.
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The stuck arrow count. |
hasStatusEffect(effect)
Checks if the living entity has the specified status effect.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
effect |
StatusEffects
|
The status effect to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity has the effect, False otherwise. |
heal(amount)
Heals the living entity by the specified amount.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amount |
Number
|
The amount to heal. |
required |
isAffectedBySplashPotions()
Checks if the living entity is affected by splash potions.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity is affected, False otherwise. |
isBaby()
Checks if the living entity is a baby.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity is a baby, False otherwise. |
isBlocking()
Checks if the living entity is currently blocking.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity is blocking, False otherwise. |
isClimbing()
Checks if the living entity is currently climbing.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity is climbing, False otherwise. |
isDead()
Checks if the living entity is dead.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity is dead, False otherwise. |
isFallFlying()
Checks if the living entity is currently fall flying.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity is fall flying, False otherwise. |
isHolding(item)
Checks if the living entity is holding the specified item.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
Item
|
The item to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity is holding the item, False otherwise. |
isHoldingOntoLadder()
Checks if the living entity is holding onto a ladder.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity is holding onto a ladder, False otherwise. |
isHurtByWater()
Checks if water hurts the living entity.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if water hurts the entity, False otherwise. |
isMobOrPlayer()
Checks if the living entity is either a mob or a player.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity is a mob or a player, False otherwise. |
isSleeping()
Checks if the living entity is sleeping.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity is sleeping, False otherwise. |
isUndead()
Checks if the living entity is undead.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity is undead, False otherwise. |
isUsingItem()
Checks if the living entity is currently using an item.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity is using an item, False otherwise. |
isUsingRiptide()
Checks if the living entity is currently using the riptide enchantment.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity is using riptide, False otherwise. |
removeStatusEffect(effect)
Removes the specified status effect from the living entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
effect |
StatusEffects
|
The status effect to remove. |
required |
setAbsorptionAmount(amount)
Sets the absorption amount of the living entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amount |
Number
|
The absorption amount to set. |
required |
setAttacker(entity)
Sets the entity that attacked this living entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
LivingEntity
|
The attacking entity. |
required |
setAttacking(entity)
Sets the entity that this living entity is currently attacking.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
LivingEntity
|
The attacking entity. |
required |
setCurrentHand(hand)
Sets the current hand of the living entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hand |
Hand
|
The hand to set as current. |
required |
setHealth(amount)
Sets the current health of the living entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amount |
Number
|
The amount to set as health. |
required |
setJumping(jumping)
Sets whether the living entity is jumping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jumping |
bool
|
True if the entity is jumping, False otherwise. |
required |
setMovementSpeed(movementSpeed)
Sets the movement speed of the living entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
movementSpeed |
Number
|
The movement speed to set. |
required |
setStackInHand(hand, stack)
Sets the item stack in the specified hand.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hand |
Hand
|
The hand to set the item stack in. |
required |
stack |
ItemStack
|
The item stack to set. |
required |
setStingerCount(stingerCount)
Sets the stinger count of the living entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stingerCount |
Number
|
The stinger count to set. |
required |
setStuckArrowCount(stuckArrowCount)
Sets the number of arrows stuck in the living entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stuckArrowCount |
Number
|
The stuck arrow count to set. |
required |
shouldDisplaySoulSpeedEffects()
Checks if the living entity should display soul speed effects.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity should display soul speed effects, False otherwise. |
shouldDropXp()
Checks if the living entity should drop experience points upon death.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the entity should drop experience points, False otherwise. |
swingHand(hand)
Swings the specified hand of the living entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hand |
Hand
|
The hand to swing. |
required |
takeKnockback(strength, x, z)
Applies knockback to the living entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
strength |
Number
|
The strength of the knockback. |
required |
x |
Number
|
The x-direction of the knockback. |
required |
z |
Number
|
The z-direction of the knockback. |
required |
teleport(position)
Teleports the living entity to the specified position.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
position |
Vec3d
|
The position to teleport to. |
required |
tiltScreen(deltaX, deltaY)
Tilts the screen of the living entity by the specified amount.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deltaX |
Number
|
The amount to tilt the screen horizontally. |
required |
deltaY |
Number
|
The amount to tilt the screen vertically. |
required |
Enchantment
The Enchantment class represents an enchantment applied to an item in Minecraft.
Attributes:
Name | Type | Description |
---|---|---|
level |
int
|
The level or magnitude of the enchantment. |
rarity |
EnchantmentRarity
|
The rarity level of the enchantment. |
ItemStack
Represents an item stack in Minecraft.
addEnchantment(enchantment, level)
Adds an enchantment to the item stack.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
enchantment |
Enchantments
|
The enchantment to add. |
required |
level |
Number
|
The level of enchantment. |
required |
addHideFlag(hideFlag)
Adds a hide flag to the item stack.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hideFlag |
HideFlags
|
The hide flag to add. |
required |
decrement(amount)
Decrements the count of items in the stack by the specified amount.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amount |
Number
|
The amount to decrement. |
required |
getCount()
Returns the number of items in the stack.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The count of items. |
getDamage()
Returns the damage value of the item stack.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The damage value. |
getEnchantments()
Returns a list of enchantments applied to the item stack.
Returns:
Type | Description |
---|---|
list[Enchantment]
|
list[Enchantment]: The list of enchantments. |
getMaxCount()
Returns the maximum count of items allowed in the stack.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The maximum count. |
getMaxDamage()
Returns the maximum damage value of the item stack.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The maximum damage value. |
getName()
Returns the name of the item.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The item name. |
getNbt()
Returns the NBT data associated with the item stack.
Returns:
Type | Description |
---|---|
dict[str, object]
|
dict[str, object]: The NBT data. |
getRarity()
Returns the rarity of the item.
Returns:
Name | Type | Description |
---|---|---|
ItemRarity |
ItemRarity
|
The item rarity. |
getRepairCost()
Returns the repair cost of the item.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The repair cost. |
hasCustomName()
Checks if the item has a custom name.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the item has a custom name, False otherwise. |
hasEnchantments()
Checks if the item has any enchantments.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the item has enchantments, False otherwise. |
hasGlint()
Checks if the item has a glint effect.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the item has a glint effect, False otherwise. |
hasNbt()
Checks if the item has NBT data.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the item has NBT data, False otherwise. |
increment(amount)
Increments the count of items in the stack by the specified amount.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amount |
Number
|
The amount to increment. |
required |
isDamageable()
Checks if the item is damageable.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the item is damageable, False otherwise. |
isDamaged()
Checks if the item is damaged.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the item is damaged, False otherwise. |
isEnchantable()
Checks if the item is enchantable.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the item is enchantable, False otherwise. |
isFood()
Checks if the item is a food item.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the item is a food item, False otherwise. |
isItemBarVisible()
Checks if the item bar is visible.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the item bar is visible, False otherwise. |
isStackable()
Checks if the item is stackable.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the item is stackable, False otherwise. |
removeCustomName()
Removes the custom name of the item.
setCount(count)
Sets the count of items in the stack.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
count |
Number
|
The count of items. |
required |
setDamage(damage)
Sets the damage value of the item stack.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
damage |
Number
|
The damage value. |
required |
setRepairCost(repairCost)
Sets the repair cost of the item.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
repairCost |
Number
|
The repair cost. |
required |
EnderChestInventory
The EnderChestInventory class represents the inventory of an Ender Chest in Minecraft.
Attributes:
Name | Type | Description |
---|---|---|
stacks |
list[ItemStack]
|
A list of ItemStack objects representing the items stored in the Ender Chest. |
HungerManager
Represents the hunger manager for a player.
Attributes:
Name | Type | Description |
---|---|---|
exhaustion |
float
|
The exhaustion level of the player. |
foodLevel |
int
|
The current food level of the player. |
saturationLevel |
float
|
The saturation level of the player. |
PlayerEntity
Bases: LivingEntity
addExhaustion(exhaustion)
Increases the exhaustion level of the player.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
exhaustion |
Number
|
The amount of exhaustion to add. |
required |
addExperience(experience)
Adds experience points to the player.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
experience |
Number
|
The number of experience points to add. |
required |
addExperienceLevels(levels)
Adds experience levels to the player.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
levels |
Number
|
The number of levels to add. |
required |
addScore(score)
Adds a score value to the player.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
score |
Number
|
The score value to add. |
required |
addShoulderEntity(entityNbt)
Adds an entity to the player's shoulder.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entityNbt |
dict[str, object]
|
The NBT data of the entity to add. |
required |
attack(entity)
Attacks the specified entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
Entity
|
The entity to attack. |
required |
canConsume(ignoreHunger)
Checks if the player can consume items.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ignoreHunger |
bool
|
Whether to ignore hunger level when checking. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the player can consume items, False otherwise. |
canFoodHeal()
Checks if the player can heal using food.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the player can heal with food, False otherwise. |
canHarvest(block)
Checks if the player can harvest the specified block.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
block |
Union[Blocks, BlockState]
|
The block to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the player can harvest the block, False otherwise. |
checkFallFlying()
Checks if the player can use elytra to fall with reduced speed.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the player can fall flying, False otherwise. |
disableShield(sprinting)
Disables the player's shield.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sprinting |
bool
|
Whether the player is sprinting. |
required |
getAttackCooldownProgress(baseTime)
Calculates the progress of the attack cooldown.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
baseTime |
Number
|
The base time for the attack cooldown. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The progress of the attack cooldown as a value between 0.0 and 1.0. |
getEnderChestInventory()
Retrieves the ender chest inventory of the player.
Returns:
Name | Type | Description |
---|---|---|
EnderChestInventory |
EnderChestInventory
|
The ender chest inventory of the player. |
getHungerManager()
Retrieves the hunger manager of the player.
Returns:
Name | Type | Description |
---|---|---|
HungerManager |
HungerManager
|
The hunger manager of the player. |
getInventory()
Retrieves the inventory of the player.
Returns:
Name | Type | Description |
---|---|---|
PlayerInventory |
PlayerInventory
|
The inventory of the player. |
getShoulderEntityLeft()
Retrieves the entity data on the player's left shoulder.
Returns:
Type | Description |
---|---|
dict[str, object]
|
dict[str, object]: The NBT data of the entity on the left shoulder. |
getShoulderEntityRight()
Retrieves the entity data on the player's right shoulder.
Returns:
Type | Description |
---|---|
dict[str, object]
|
dict[str, object]: The NBT data of the entity on the right shoulder. |
isCreative()
Checks if the player is in creative mode.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the player is in creative mode, False otherwise. |
isMainPlayer()
Checks if the player is the main player.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the player is the main player, False otherwise. |
isUsingSpyglass()
Checks if the player is using a spyglass.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the player is using a spyglass, False otherwise. |
requestRespawn()
Requests the player to respawn.
sendMessage(message)
Sends a message to the player.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
str
|
The message to send. |
required |
setMainArm(arm)
Sets the player's main arm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arm |
Arm
|
The main arm to set. |
required |
PlayerInventory
clear()
Clears the player's inventory.
contains(stack)
Checks if the inventory contains the specified item stack.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stack |
ItemStack
|
The item stack to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the inventory contains the item stack, False otherwise. |
dropAll()
Drops all items from the inventory.
dropSelectedItem(entireStack)
Drops the selected item from the inventory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entireStack |
bool
|
Whether to drop the entire stack or just one item. |
required |
getArmorStack(slot)
Retrieves the item stack in the specified armor slot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
slot |
Number
|
The armor slot. |
required |
Returns:
Name | Type | Description |
---|---|---|
ItemStack |
ItemStack
|
The item stack in the specified armor slot. |
getEmptySlot()
Retrieves the index of an empty slot in the inventory.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The index of an empty slot, or -1 if no empty slot is found. |
getMainHandStack()
Retrieves the item stack in the player's main hand.
Returns:
Name | Type | Description |
---|---|---|
ItemStack |
ItemStack
|
The item stack in the player's main hand. |
getSlotWithStack(stack)
Retrieves the index of the slot that contains the specified item stack.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stack |
ItemStack
|
The item stack to search for. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The index of the slot that contains the item stack, or -1 if not found. |
getStack(slot)
Retrieves the item stack in the specified slot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
slot |
Number
|
The slot index. |
required |
Returns:
Name | Type | Description |
---|---|---|
ItemStack |
ItemStack
|
The item stack in the specified slot. |
indexOf(stack)
Retrieves the index of the first occurrence of the specified item stack.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stack |
ItemStack
|
The item stack to search for. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The index of the first occurrence of the item stack, or -1 if not found. |
isEmpty()
Checks if the inventory is empty.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the inventory is empty, False otherwise. |
removeOne(stack)
Removes one item from the specified item stack.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stack |
ItemStack
|
The item stack to remove from. |
required |
setStack(slot, stack)
Sets the item stack in the specified slot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
slot |
Number
|
The slot index. |
required |
stack |
ItemStack
|
The item stack to set. |
required |
PlayerManager
Manages players.
areCheatsAllowed()
Checks if cheats are allowed.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if cheats are allowed, False otherwise. |
disconnectAllPlayers()
Disconnects all players.
getCurrentPlayerCount()
Retrieves the current count of players.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The current count of players. |
getMaxPlayerCount()
Retrieves the maximum allowed count of players.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The maximum allowed count of players. |
getOpNames()
Retrieves the names of all operators.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: The names of all operators. |
getPlayer(name)
Retrieves the player entity with the specified name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the player. |
required |
Returns:
Name | Type | Description |
---|---|---|
PlayerEntity |
PlayerEntity
|
The player entity. |
getPlayerList()
Retrieves a list of all player entities.
Returns:
Type | Description |
---|---|
list[PlayerEntity]
|
list[PlayerEntity]: A list of player entities. |
getPlayerNames()
Retrieves the names of all players.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: The names of all players. |
getViewDistance()
Retrieves the view distance setting.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The view distance. |
getWhitelistedNames()
Retrieves the names of all whitelisted players.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: The names of all whitelisted players. |
isWhitelistEnabled()
Checks if the whitelist is enabled.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the whitelist is enabled, False otherwise. |
reloadWhitelist()
Reloads the whitelist configuration.
setCheatsAllowed(cheatsAllowed)
Sets whether cheats are allowed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cheatsAllowed |
bool
|
True to allow cheats, False to disallow cheats. |
required |
setSimulationDistance(simulationDistance)
Sets the simulation distance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
simulationDistance |
int
|
The simulation distance value. |
required |
setViewDistance(viewDistance)
Sets the view distance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
viewDistance |
int
|
The view distance value. |
required |
setWhitelistEnabled(whitelistEnabled)
Sets whether the whitelist is enabled.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
whitelistEnabled |
bool
|
True to enable the whitelist, False to disable the whitelist. |
required |
Scoreboard
addObjective(name, criterion, displayName, renderType)
Adds a new objective to the scoreboard.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the objective. |
required |
criterion |
ScoreboardCriterions
|
The criterion type of the objective. |
required |
displayName |
Text
|
The display name of the objective. |
required |
renderType |
RenderTypes
|
The render type of the objective. |
required |
addPlayerToTeam(playerName, team)
Adds a player to the specified team.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
playerName |
str
|
The name of the player. |
required |
team |
Team
|
The team to add the player to. |
required |
addTeam(name)
Adds a new team to the scoreboard.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the team. |
required |
clearPlayerTeam(playerName)
Clears the team association of a player.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
playerName |
str
|
The name of the player. |
required |
containsObjective(name)
Checks if an objective with the specified name exists in the scoreboard.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the objective. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the objective exists, False otherwise. |
getAllPlayerScores(objective)
Retrieves a list of all player scores for the specified objective.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
objective |
ScoreboardObjective
|
The objective to retrieve player scores for. |
required |
Returns:
Type | Description |
---|---|
list[ScoreboardPlayerScore]
|
list[ScoreboardPlayerScore]: A list of all player scores for the objective. |
getObjective(name)
Retrieves the objective with the specified name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the objective. |
required |
Returns:
Name | Type | Description |
---|---|---|
ScoreboardObjective |
ScoreboardObjective
|
The objective object. |
getObjectiveNames()
Retrieves a list of names from all the objectives on the scoreboard.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: A list of names from all the objectives on the scoreboard. |
getObjectives()
Retrieves a list of all objectives on the scoreboard.
Returns:
Type | Description |
---|---|
list[ScoreboardObjective]
|
list[ScoreboardObjective]: A list of all objectives on the scoreboard. |
getPlayerScore(name, objective)
Retrieves the score of a player for the specified objective.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the player. |
required |
objective |
ScoreboardObjective
|
The objective to retrieve the player's score for. |
required |
Returns:
Name | Type | Description |
---|---|---|
ScoreboardPlayerScore |
ScoreboardPlayerScore
|
The player's score for the objective. |
getPlayerTeam(name)
Retrieves the team associated with the specified player.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the player. |
required |
Returns:
Name | Type | Description |
---|---|---|
Team |
Team
|
The associated team object. |
getTeam(name)
Retrieves the team with the specified name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the team. |
required |
Returns:
Name | Type | Description |
---|---|---|
Team |
Team
|
The team object. |
getTeamNames()
Retrieves a list of names from all the teams on the scoreboard.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: A list of names from all the teams on the scoreboard. |
getTeams()
Retrieves a list of all teams on the scoreboard.
Returns:
Type | Description |
---|---|
list[Team]
|
list[Team]: A list of all teams on the scoreboard. |
removeObjective(objective)
Removes the specified objective from the scoreboard.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
objective |
ScoreboardObjective
|
The objective to remove. |
required |
removePlayerFromTeam(playerName, team)
Removes a player from the specified team.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
playerName |
str
|
The name of the player. |
required |
team |
Team
|
The team to remove the player from. |
required |
removeTeam(team)
Removes the specified team from the scoreboard.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
team |
Team
|
The team to remove. |
required |
resetEntityScore(entity)
Resets the score of an entity on all objectives.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
Entity
|
The entity. |
required |
resetPlayerScore(playerName, objective)
Resets the score of a player for the specified objective.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
playerName |
str
|
The name of the player. |
required |
objective |
ScoreboardObjective
|
The objective to reset the player's score for. |
required |
ScoreboardObjective
getCriterion()
Retrieves the criterion type of the scoreboard objective.
Returns:
Name | Type | Description |
---|---|---|
ScoreboardCriterions |
ScoreboardCriterions
|
The criterion type of the objective. |
getDisplayName()
Retrieves the display name of the scoreboard objective.
Returns:
Name | Type | Description |
---|---|---|
Text |
Text
|
The display name of the objective. |
getName()
Retrieves the name of the scoreboard objective.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name of the objective. |
getRenderType()
Retrieves the render type of the scoreboard objective.
Returns:
Name | Type | Description |
---|---|---|
RenderTypes |
RenderTypes
|
The render type of the objective. |
setDisplayName(displayName)
Sets the display name of the scoreboard objective.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
displayName |
Text
|
The display name to set. |
required |
setRenderType(renderType)
Sets the render type of the scoreboard objective.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
renderType |
RenderTypes
|
The render type to set. |
required |
ScoreboardPlayerScore
clearScore()
Clears the score of the player.
getPlayerName()
Retrieves the name of the player associated with the score.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name of the player. |
getScore()
Retrieves the score value.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The score value. |
getScoreboard()
Retrieves the scoreboard associated with the score.
Returns:
Name | Type | Description |
---|---|---|
Scoreboard |
Scoreboard
|
The associated scoreboard object. |
setScore(score)
Sets the score value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
score |
Number
|
The score value to set. |
required |
Team
getCollisionRule()
Returns the collision rule of the team.
Returns:
Name | Type | Description |
---|---|---|
CollisionRules |
CollisionRules
|
The collision rule of the team. |
getColor()
Returns the color of the team.
Returns:
Name | Type | Description |
---|---|---|
Formatting |
Formatting
|
The color of the team. |
getDeathMessageVisibilityRule()
Returns the death message visibility rule of the team.
Returns:
Name | Type | Description |
---|---|---|
VisibilityRules |
VisibilityRules
|
The death message visibility rule of the team. |
getDisplayName()
Returns the display name of the team.
Returns:
Name | Type | Description |
---|---|---|
Text |
Text
|
The display name of the team. |
getName()
Returns the name of the team.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name of the team. |
getNameTagVisibilityRule()
Returns the name tag visibility rule of the team.
Returns:
Name | Type | Description |
---|---|---|
VisibilityRules |
VisibilityRules
|
The name tag visibility rule of the team. |
getPlayerList()
Returns the list of players in the team.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: The list of players in the team. |
getPrefix()
Returns the prefix of the team.
Returns:
Name | Type | Description |
---|---|---|
Text |
Text
|
The prefix of the team. |
getSuffix()
Returns the suffix of the team.
Returns:
Name | Type | Description |
---|---|---|
Text |
Text
|
The suffix of the team. |
isFriendlyFireAllowed()
Checks if friendly fire is allowed for the team.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if friendly fire is allowed, False otherwise. |
setCollisionRule(collisionRule)
Sets the collision rule for the team.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collisionRule |
CollisionRules
|
The collision rule to set for the team. |
required |
setColor(formatting)
Sets the color of the team.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
formatting |
Formatting
|
The color formatting to set for the team. |
required |
setDeathMessageVisibilityRule(deathMessageVisibilityRule)
Sets the death message visibility rule for the team.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deathMessageVisibilityRule |
VisibilityRules
|
The death message visibility rule to set for the team. |
required |
setDisplayName(displayName)
Sets the display name of the team.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
displayName |
Text
|
The display name to set for the team. |
required |
setFriendlyFireAllowed(friendlyFireAllowed)
Sets whether friendly fire is allowed for the team.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
friendlyFireAllowed |
bool
|
A boolean value indicating whether friendly fire is allowed. |
required |
setNameTagVisibilityRule(nameTagVisibilityRule)
Sets the name tag visibility rule for the team.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nameTagVisibilityRule |
VisibilityRules
|
The name tag visibility rule to set for the team. |
required |
setPrefix(prefix)
Sets the prefix of the team.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prefix |
Text
|
The prefix to set for the team. |
required |
setShowFriendlyInvisibles(showFriendlyInvisibles)
Sets whether to show friendly invisibles for the team.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
showFriendlyInvisibles |
bool
|
A boolean value indicating whether to show friendly invisibles. |
required |
setSuffix(suffix)
Sets the suffix of the team.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
suffix |
Text
|
The suffix to set for the team. |
required |
shouldShowFriendlyInvisibles()
Checks if friendly invisibles are shown for the team.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if friendly invisibles are shown, False otherwise. |
Vec2f
Represents a two-dimensional vector.
Attributes:
Name | Type | Description |
---|---|---|
x |
float
|
The x-coordinate of the vector. |
y |
float
|
The y-coordinate of the vector. |
__init__(x, y)
Initializes a Vec2f instance with the given coordinates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
float
|
The x-coordinate of the vector. |
required |
y |
float
|
The y-coordinate of the vector. |
required |
Vec3d
Represents a three-dimensional vector.
Attributes:
Name | Type | Description |
---|---|---|
x |
float
|
The x-coordinate of the vector. |
y |
float
|
The y-coordinate of the vector. |
z |
float
|
The z-coordinate of the vector. |
__init__(x, y, z)
Initializes a Vec3d instance with the given coordinates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
float
|
The x-coordinate of the vector. |
required |
y |
float
|
The y-coordinate of the vector. |
required |
z |
float
|
The z-coordinate of the vector. |
required |
Executor
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the executor. |
displayName |
str
|
The display name of the executor. |
position |
Vec3d
|
The position of the executor. |
player |
PlayerEntity
|
The player entity associated with the executor. |
world |
World
|
The world in which the executor exists. |
entity |
Entity
|
The entity associated with the executor. |
isExecutedByPlayer |
bool
|
Indicates if the executor is executed by a player. |
rotation |
Vec2f
|
The rotation of the executor. |
World
Represents a world.
getAllEntities()
Retrieves a list of all entities in the game, including players and non-players.
Returns:
Type | Description |
---|---|
list[PlayerEntity]
|
A list of PlayerEntity objects representing all entities in the game. |
getAllPlayers()
Retrieves a list of all player entities in the game.
Returns:
Type | Description |
---|---|
list[PlayerEntity]
|
A list of PlayerEntity objects representing all players in the game. |
getDifficulty()
Retrieves the difficulty level of the world.
Returns:
Name | Type | Description |
---|---|---|
Difficulty |
Difficulty
|
The difficulty level of the world. |
getNearestPlayer(position)
Finds the nearest player entity to the specified position.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
position |
Vec3d
|
The position from which to search for the nearest player. |
required |
Returns:
Type | Description |
---|---|
PlayerEntity
|
The PlayerEntity object representing the nearest player to the specified position. |
getRandomPlayer()
Selects a random player entity from the game.
Returns:
Type | Description |
---|---|
PlayerEntity
|
A randomly chosen PlayerEntity object from the available players in the game. |
getSeed()
Retrieves the seed value of the world.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The seed value of the world. |
setTime(time)
Sets the current time of the world.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time |
Time
|
The time value to be set. |
required |
Server
getDefaultGameMode()
Retrieves the default game mode for new players.
Returns:
Name | Type | Description |
---|---|---|
GameMode |
GameMode
|
The default game mode. |
getForcedGameMode()
Retrieves the forced game mode for all players.
Returns:
Name | Type | Description |
---|---|---|
GameMode |
GameMode
|
The forced game mode. |
getMaxWorldBorderRadius()
Retrieves the maximum radius of the world border.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The maximum world border radius. |
getPlayerManager()
Retrieves the player manager for the server_.
Returns:
Name | Type | Description |
---|---|---|
PlayerManager |
PlayerManager
|
The player manager object. |
getScoreboard()
Retrieves the scoreboard for the server_.
Returns:
Name | Type | Description |
---|---|---|
Scoreboard |
Scoreboard
|
The scoreboard object. |
getServerIP()
Retrieves the IP address of the server_.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The server_ IP address. |
getServerMOTD()
Retrieves the MOTD (Message of the Day) of the server_.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The server_ MOTD. |
getServerPort()
Retrieves the port number on which the server_ is running.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The server_ port number. |
getSpawnProtectionRadius()
Retrieves the radius of spawn protection around the world spawn point.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The spawn protection radius. |
getSpawnRadius(world)
Retrieves the spawn radius for the specified world type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
world |
Worlds
|
The type of the world to retrieve the spawn radius for. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The spawn radius of the world. |
getVersion()
Retrieves the version of the server_.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The server_ version. |
getWorld(world)
Retrieves the world object for the specified world type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
world |
Worlds
|
The type of the world to retrieve. |
required |
Returns:
Name | Type | Description |
---|---|---|
World |
World
|
The world object. |
isFlightEnabled()
Checks if flight is enabled on the server_.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if flight is enabled, False otherwise. |
isHardcore()
Checks if the server_ is in hardcore mode.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the server_ is in hardcore mode, False otherwise. |
isMonsterSpawningEnabled()
Checks if monster spawning is enabled on the server_.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if monster spawning is enabled, False otherwise. |
isNetherAllowed()
Checks if the Nether dimension is allowed on the server_.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the Nether is allowed, False otherwise. |
isPVPEnabled()
Checks if PVP (Player vs. Player) is enabled on the server_.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if PVP is enabled, False otherwise. |
isSingleplayer()
Checks if the server_ is running in singleplayer mode.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the server_ is in singleplayer mode, False otherwise. |
openToLAN(gameMode, cheatsAllowed, port)
Opens the server_ to LAN (Local Area Network) with the specified settings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gameMode |
GameModes
|
The game mode for LAN players. |
required |
cheatsAllowed |
bool
|
Whether cheats are allowed for LAN players. |
required |
port |
Number
|
The port number to use for LAN connections. |
required |
setDefaultGameMode(defaultGameMode)
Sets the default game mode for new players.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
defaultGameMode |
GameModes
|
The default game mode to set. |
required |
setDifficulty(difficulty)
Sets the difficulty level of the server_.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
difficulty |
Difficulties
|
The difficulty level to set. |
required |
setDifficultyLocked(difficultyLocked)
Sets whether the difficulty level is locked on the server_.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
difficultyLocked |
bool
|
True to lock the difficulty level, False otherwise. |
required |