Script API - v1.21.90.25
    Preparing search index...

    Module @minecraft/server - v2.1.0-betaBeta

    Contains many types related to manipulating a Minecraft world, including entities, blocks, dimensions, and more.

    Manifest Details

    {
    "module_name": "@minecraft/server",
    "version": "2.1.0-beta"
    }

    @minecraft/common (Optional in Manifest Details)

    • Requires v1.1.0 or above
    {
    "module_name": "@minecraft/common",
    "version": "1.1.0"
    }

    Install type definition for @minecraft/server module using npm:

    npm i @minecraft/server@2.1.0-beta.1.21.90-preview.25
    

    Enumerations

    AimAssistTargetMode

    Specifies different targeting modes for use in aim-assist.

    BlockComponentTypes

    The types of block components that are accessible via function Block.getComponent.

    BlockPistonState

    An enumeration describing the state of a block piston.

    BlockVolumeIntersection

    Description of the resulting intersection test on two BlockVolume objects

    ButtonState

    The state of a button on a keyboard, controller, or touch interface.

    CommandPermissionLevel

    The required permission level to execute the custom command.

    CompoundBlockVolumeAction

    The Action enum determines how the CompoundBlockVolume considers the associated CompoundBlockVolumeItem when performing inside/outside calculations.

    CompoundBlockVolumePositionRelativity

    An enum describing the relativity of the CompoundBlockVolumeItem, relative to the parent CompoundVolume.

    ContainerRulesErrorReason

    Reasons that the @minecraft/server.ContainerRulesError was thrown.

    CustomCommandErrorReason

    Reason why custom command registration failed.

    CustomCommandParamType

    The types of paramaters accepted by a custom command.

    CustomCommandSource

    Who executed the command.

    CustomCommandStatus
    CustomComponentNameErrorReason
    Difficulty

    An enumeration for the various difficulty levels of Minecraft.

    Direction

    A general purpose relative direction enumeration.

    DisplaySlotId

    Specifies a mechanism for displaying scores on a scoreboard.

    DyeColor

    Specifies different colors for use as dye.

    EasingType
    EnchantmentSlot
    EntityComponentTypes

    The types of entity components that are accessible via function Entity.getComponent.

    EntityDamageCause

    Describes the source of damage from an Entity.

    EntityInitializationCause

    An enumeration describing initialization cause of an entity.

    EquipmentSlot

    The equipment slot of the mob. This includes armor, offhand and mainhand slots.

    FluidType

    Represents the type of fluid for use within a fluid containing block, like a cauldron.

    GameMode

    Represents a game mode for the current world experience.

    GameRule

    Game rules. These values can also be controlled via the /gamerule command.

    GraphicsMode

    Describes the graphics mode of a client. Used by Player.graphicsMode

    HudElement
    HudVisibility

    Enumeration that specifies how to treat the visibility of a HUD element.

    InputButton

    All the different input buttons that are supported. Use with InputInfo.getButtonState via Player.inputInfo or PlayerButtonInputAfterEvent via WorldAfterEvents.playerButtonInput

    InputMode

    Describes the type of input of a device.

    InputPermissionCategory

    Input permission categories. Used by PlayerInputPermissionCategoryChangeAfterEvent to specify which category was changed and PlayerInputPermissions to get or set permissions.

    ItemComponentTypes

    The types of item components that are accessible via function ItemStack.getComponent.

    ItemLockMode

    Describes how an an item can be moved within a container.

    LiquidSettings

    Specifies how to handle waterloggable blocks overlapping with existing liquid.

    LiquidType

    Represents the type of liquid that can be placed on a block or flow dynamically in the world.

    MemoryTier

    Describes the memory of a device.

    MoonPhase

    Enum containing the different phases of the moon based on the current day.,Obtain the current MoonPhase using world.getMoonPhase.

    NamespaceNameErrorReason

    An enumeration describing the reason for the namespace name error being thrown

    ObjectiveSortOrder

    Used for specifying a sort order for how to display an objective and its list of participants.

    PaletteColor

    Enum containing colors to be used with EntityColorComponent and EntityColor2Component

    PlatformType

    Describes what kind of platform is a device.

    PlayerInventoryType

    Specifies the player inventory type.

    PlayerPermissionLevel

    The player permission level.

    ScoreboardIdentityType

    Contains objectives and participants for the scoreboard.

    ScriptEventSource

    Describes where the script event originated from.

    SignSide

    Represents a side of a sign.

    StructureAnimationMode

    Specifies how structure blocks should be animated when a structure is placed.

    StructureMirrorAxis

    Specifies how a structure should be mirrored when placed.

    StructureRotation

    Enum describing a structure's placement rotation.

    StructureSaveMode

    Specifies how a structure should be saved.

    TimeOfDay

    Provides numeric values for common periods in the Minecraft day.

    TintMethod

    Tint logic applied to a block or part of a block. The color may vary when a world position is part of the context, as biomes often have an influence on the resulting tint.

    WatchdogTerminateReason

    An enumeration with the reason that a watchdog is deciding to terminate execution of a behavior packs' script.

    WeatherType

    Used to specify the type of weather condition within the world.

    Classes

    AimAssistCategory

    Handle to an aim-assist category that exists in the world.aimAssist registry.

    AimAssistCategorySettings

    Settings used with AimAssistRegistry.addCategory for creation of the AimAssistCategory.

    AimAssistPreset

    Handle to an aim-assist preset that exists in the world.aimAssist registry.

    AimAssistPresetSettings

    Settings used with AimAssistRegistry.addPreset for creation of the AimAssistPreset.

    AimAssistRegistry

    A container for APIs related to the world's aim-assist settings.

    BiomeType

    Describes a type of biome.

    BiomeTypes

    Supports a catalog of available biome types registered within Minecraft.

    Block

    Represents a block in a dimension. A block represents a unique X, Y, and Z within a dimension and get/sets the state of the block at that location. This type was significantly updated in version 1.17.10.21.

    BlockBoundingBoxUtils

    Bounding Box Utils is a utility class that provides a number of useful functions for the creation and utility of BlockBoundingBox objects

    BlockComponent

    Base type for components associated with blocks.

    BlockComponentEntityFallOnEvent

    Contains information regarding an entity falling onto a specific block.

    BlockComponentOnPlaceEvent

    Contains information regarding a specific block that was placed.

    BlockComponentPlayerBreakEvent

    Contains information regarding a specific block being broken by a player.

    BlockComponentPlayerInteractEvent

    Contains information regarding a specific block being interacted with.

    BlockComponentPlayerPlaceBeforeEvent

    Contains information regarding an event before a player places a block.

    BlockComponentRandomTickEvent

    Contains information regarding a specific block randomly ticking.

    BlockComponentRegistry
    BlockComponentStepOffEvent

    Contains information regarding an entity stepping off a specific block.

    BlockComponentStepOnEvent

    Contains information regarding an entity stepping onto a specific block.

    BlockComponentTickEvent

    Contains information regarding a specific block ticking.

    BlockCustomComponentAlreadyRegisteredError
    BlockCustomComponentInstance

    An instance of a custom component on a block.

    BlockCustomComponentReloadNewComponentError
    BlockCustomComponentReloadNewEventError
    BlockCustomComponentReloadVersionError
    BlockDestructionParticlesComponent

    Represents the particles that appear when the block is destroyed.

    BlockEvent

    Contains information regarding an event that impacts a specific block.

    BlockExplodeAfterEvent

    Contains information regarding an explosion that has occurred for a specific block.

    BlockExplodeAfterEventSignal

    Manages callbacks that are connected to when an explosion occurs, as it impacts individual blocks.

    BlockFluidContainerComponent

    Represents the fluid container of a block in the world. Used with blocks like cauldrons.

    BlockInventoryComponent

    Represents the inventory of a block in the world. Used with blocks like chests.

    BlockLocationIterator

    A BlockLocationIterator returns the next block location of the block volume across which it is iterating. The BlockLocationIterator is used to abstract the shape of the block volume it was fetched from (so it can represent all the block locations that make up rectangles, cubes, spheres, lines and complex shapes). Each iteration pass returns the next valid block location in the parent shape. Unless otherwise specified by the parent shape - the BlockLocationIterator will iterate over a 3D space in the order of increasing X, followed by increasing Z followed by increasing Y. (Effectively stepping across the XZ plane, and when all the locations in that plane are exhausted, increasing the Y coordinate to the next XZ slice)

    BlockMapColorComponent

    Represents the color of a block when displayed on a map.

    BlockPermutation

    Contains the combination of type BlockType and properties (also sometimes called block state) which describe a block (but does not belong to a specific Block).

    BlockPistonComponent

    When present, this block has piston-like behavior. Contains additional properties for discovering block piston state.

    BlockRecordPlayerComponent

    Represents a block that can play a record.

    BlockSignComponent

    Represents a block that can display text on it.

    BlockStates

    Enumerates all BlockStateTypes.

    BlockStateType

    Represents a configurable state value of a block instance. For example, the facing direction of stairs is accessible as a block state.

    BlockType

    The type (or template) of a block. Does not contain permutation data (state) other than the type of block it represents. This type was introduced as of version 1.17.10.21.

    BlockTypes

    Contains a catalog of Minecraft Block Types that are available in this world.

    BlockVolume

    A BlockVolume is a simple interface to an object which represents a 3D rectangle of a given size (in blocks) at a world block location. Note that these are not analogous to "min" and "max" values, in that the vector components are not guaranteed to be in any order. In addition, these vector positions are not interchangeable with BlockLocation. If you want to get this volume represented as range of of BlockLocations, you can use the getBoundingBox utility function. This volume class will maintain the ordering of the corner indexes as initially set. imagine that each corner is assigned in Editor - as you move the corner around (potentially inverting the min/max relationship of the bounds) - what you had originally selected as the top/left corner would traditionally become the bottom/right. When manually editing these kinds of volumes, you need to maintain the identity of the corner as you edit - the BlockVolume utility functions do this.

    BlockVolumeBase

    Base type for BlockVolumes.

    ButtonPushAfterEvent

    Contains information related to changes to a button push.

    ButtonPushAfterEventSignal

    Manages callbacks that are connected to when a button is pushed.

    Camera

    Contains methods relating to the active camera for the specified player.

    ChatSendAfterEvent

    An event that fires as players enter chat messages.

    ChatSendAfterEventSignal

    Manages callbacks that are connected to chat messages being sent.

    ChatSendBeforeEvent

    An event that fires as players enter chat messages.

    ChatSendBeforeEventSignal

    Manages callbacks that are connected to an event that fires before chat messages are sent.

    ClientSystemInfo

    Contains the device information for a client instance.

    CommandError
    CommandResult

    Contains return data on the result of a command execution.

    Component

    Base class for downstream Component implementations.

    CompoundBlockVolume

    The Compound Block Volume is a collection of individual block volume definitions which, as a collection, define a larger volume of (sometimes non-contiguous) irregular shapes. This class is loosely based on the concept of CSG (Computational Solid Geometry) and allows a user to create complex volumes by building a stack of volumes and voids to make a larger single volume. For example - normally a creator would create a hollow cube by creating 6 "wall" surfaces for each face. With a Compound Block Volume, a creator can define a hollow cube by creating a single outer solid cube, and then defining a further single 'void' cube inside the larger one. Similarly, the Compound Block Volume can represent irregular shaped volumes (e.g. a tree consists of a trunk and lots of leaf cubes which are not necessarily contiguously placed). Each of the volumes added to the CompoundBlockVolume are (by default) relative to the origin set (either at construction or via one of the set functions). However, it is also possible to push volumes to the compound collection which are absolute in nature and are not affected by origin changes.

    Container

    Represents a container that can hold sets of items. Used with entities such as Players, Chest Minecarts, Llamas, and more.

    ContainerRulesError

    Error thrown if ContainerRules are broken on container operations.

    ContainerSlot

    Represents a slot within a broader container (e.g., entity inventory.)

    CustomCommandError

    Error object thrown when CustomCommandRegistry errors occur.

    CustomCommandOrigin

    Details about the origins of the command.

    CustomCommandRegistry

    Provides the functionality for registering custom commands.

    CustomComponentInvalidRegistryError
    CustomComponentNameError
    CustomComponentParameters

    Contains the custom component's JSON parameters

    DataDrivenEntityTriggerAfterEvent

    Contains information related to firing of a data driven entity event - for example, the minecraft:ageable_grow_up event on a chicken.

    DataDrivenEntityTriggerAfterEventSignal

    Contains event registration related to firing of a data driven entity event - for example, the minecraft:ageable_grow_up event on a chicken.

    Dimension

    A class that represents a particular dimension (e.g., The End) within a world.

    DimensionType

    Represents a type of dimension.

    DimensionTypes

    Used for accessing all available dimension types.

    Effect

    Represents an effect - like poison - that has been added to an Entity.

    EffectAddAfterEvent

    Contains information related to changes to an effect - like poison - being added to an entity.

    EffectAddAfterEventSignal

    Manages callbacks that are connected to when an effect is added to an entity.

    EffectAddBeforeEvent

    Contains information related to changes to an effect - like poison - being added to an entity.

    EffectAddBeforeEventSignal

    Manages callbacks that are connected to when an effect is added to an entity.

    EffectType

    Represents a type of effect - like poison - that can be applied to an entity.

    EffectTypes

    Represents a type of effect - like poison - that can be applied to an entity.

    EnchantmentLevelOutOfBoundsError
    EnchantmentType

    Contains information on a type of enchantment.

    EnchantmentTypeNotCompatibleError
    EnchantmentTypes

    Contains a catalog of Minecraft Enchantment Types that are available in this world.

    EnchantmentTypeUnknownIdError
    Entity

    Represents the state of an entity (a mob, the player, or other moving objects like minecarts) in the world.

    EntityAddRiderComponent

    When added, this component makes the entity spawn with a rider of the specified entityType.

    EntityAgeableComponent

    Adds a timer for the entity to grow up. It can be accelerated by giving the entity the items it likes as defined by feedItems.

    EntityAttributeComponent

    This is a base abstract class for any entity component that centers around a number and can have a minimum, maximum, and default defined value.

    EntityBaseMovementComponent

    Base class for a family of entity movement events.

    EntityBreathableComponent

    Defines what blocks this entity can breathe in and gives them the ability to suffocate.

    EntityCanClimbComponent

    When added, this component signifies that the entity can climb up ladders.

    EntityCanFlyComponent

    When added, this component signifies that the entity can fly, and the pathfinder won't be restricted to paths where a solid block is required underneath it.

    EntityCanPowerJumpComponent

    When added, this component signifies that the entity can power jump like the horse does within Minecraft.

    EntityColor2Component

    Defines the entity's secondary color. Only works on certain entities that have secondary predefined color values (e.g., tropical fish).

    EntityColorComponent

    Defines the entity's color. Only works on certain entities that have predefined color values (e.g., sheep, llama, shulker).

    EntityComponent

    Base class for downstream entity components.

    EntityDefinitionFeedItem

    As part of the Ageable component, represents a set of items that can be fed to an entity and the rate at which that causes them to grow.

    EntityDieAfterEvent

    Contains data related to the death of an entity in the game.

    EntityDieAfterEventSignal

    Supports registering for an event that fires after an entity has died.

    EntityEquippableComponent

    Provides access to a mob's equipment slots. This component exists for all mob entities.

    EntityFireImmuneComponent

    When added, this component signifies that this entity doesn't take damage from fire.

    EntityFloatsInLiquidComponent

    When added, this component signifies that this entity can float in liquid blocks.

    EntityFlyingSpeedComponent

    Represents the flying speed of an entity.

    EntityFrictionModifierComponent

    Defines how much friction affects this entity.

    EntityHealableComponent

    Defines the interactions with this entity for healing it.

    EntityHealthChangedAfterEvent

    Contains information related to an entity when its health changes. Warning: don't change the health of an entity in this event, or it will cause an infinite loop!

    EntityHealthChangedAfterEventSignal

    Manages callbacks that are connected to when the health of an entity changes.

    EntityHealthComponent

    Defines the health properties of an entity.

    EntityHitBlockAfterEvent

    Contains information related to an entity hitting a block.

    EntityHitBlockAfterEventSignal

    Manages callbacks that are connected to when an entity hits a block.

    EntityHitEntityAfterEvent

    Contains information related to an entity hitting (melee attacking) another entity.

    EntityHitEntityAfterEventSignal

    Manages callbacks that are connected to when an entity makes a melee attack on another entity.

    EntityHurtAfterEvent

    Contains information related to an entity getting hurt.

    EntityHurtAfterEventSignal

    Manages callbacks that are connected to when an entity is hurt.

    EntityInventoryComponent

    Defines this entity's inventory properties.

    EntityIsBabyComponent

    When added, this component signifies that this entity is a baby.

    EntityIsChargedComponent

    When added, this component signifies that this entity is charged.

    EntityIsChestedComponent

    When added, this component signifies that this entity is currently carrying a chest.

    EntityIsDyeableComponent

    When added, this component signifies that dyes can be used on this entity to change its color.

    EntityIsHiddenWhenInvisibleComponent

    When added, this component signifies that this entity can hide from hostile mobs while invisible.

    EntityIsIgnitedComponent

    When added, this component signifies that this entity this currently on fire.

    EntityIsIllagerCaptainComponent

    When added, this component signifies that this entity is an illager captain.

    EntityIsSaddledComponent

    When added, this component signifies that this entity is currently saddled.

    EntityIsShakingComponent

    When added, this component signifies that this entity is currently shaking.

    EntityIsShearedComponent

    When added, this component signifies that this entity is currently sheared.

    EntityIsStackableComponent

    When added, this component signifies that this entity can be stacked.

    EntityIsStunnedComponent

    When added, this component signifies that this entity is currently stunned.

    EntityIsTamedComponent

    When added, this component signifies that this entity is currently tamed.

    EntityItemComponent

    If added onto the entity, this indicates that the entity represents a free-floating item in the world. Lets you retrieve the actual item stack contents via the itemStack property.

    EntityLavaMovementComponent

    Defines the base movement speed in lava of this entity.

    EntityLeashableComponent

    Allows the entity to be leashed. Defines the conditions and events for when an entity is leashed.

    EntityLoadAfterEvent

    Contains data related to an entity loaded within the world. This could happen when an unloaded chunk is reloaded, or when an entity changes dimensions.

    EntityLoadAfterEventSignal

    Registers a script-based event handler for handling what happens when an entity loads.

    EntityMarkVariantComponent

    Additional variant value. Can be used to further differentiate variants.

    EntityMovementAmphibiousComponent

    When added, this movement control allows the mob to swim in water and walk on land.

    EntityMovementBasicComponent

    This component accents the movement of an entity.

    EntityMovementComponent

    Defines the general movement speed of this entity.

    EntityMovementFlyComponent

    When added, this move control causes the mob to fly.

    EntityMovementGenericComponent

    When added, this move control allows a mob to fly, swim, climb, etc.

    EntityMovementGlideComponent

    When added, this movement control allows the mob to glide.

    EntityMovementHoverComponent

    When added, this move control causes the mob to hover.

    EntityMovementJumpComponent

    Move control that causes the mob to jump as it moves with a specified delay between jumps.

    EntityMovementSkipComponent

    When added, this move control causes the mob to hop as it moves.

    EntityMovementSwayComponent

    When added, this move control causes the mob to sway side to side giving the impression it is swimming.

    EntityNavigationClimbComponent

    Allows this entity to generate paths that include vertical walls (for example, like Minecraft spiders do.)

    EntityNavigationComponent

    Allows this entity to generate paths that include vertical walls (for example, like Minecraft spiders do.)

    EntityNavigationFloatComponent

    Allows this entity to generate paths by flying around the air like the regular Ghast.

    EntityNavigationFlyComponent

    Allows this entity to generate paths in the air (for example, like Minecraft parrots do.)

    EntityNavigationGenericComponent

    Allows this entity to generate paths by walking, swimming, flying and/or climbing around and jumping up and down a block.

    EntityNavigationHoverComponent

    Allows this entity to generate paths in the air (for example, like the Minecraft Bees do.) Keeps them from falling out of the skies and doing predictive movement.

    EntityNavigationWalkComponent

    Allows this entity to generate paths by walking around and jumping up and down a block like regular mobs.

    EntityNpcComponent

    Adds NPC capabilities to an entity such as custom skin, name, and dialogue interactions.

    EntityOnFireComponent

    When present on an entity, this entity is on fire.

    EntityProjectileComponent

    The projectile component controls the properties of a projectile entity and allows it to be shot in a given direction. This component is present when the entity has the minecraft:projectile component.

    EntityPushThroughComponent

    Sets the distance through which the entity can push through.

    EntityRemoveAfterEvent

    Data for an event that happens when an entity is removed from the world (for example, the entity is unloaded because it is not close to players.)

    EntityRemoveAfterEventSignal

    Allows registration for an event that fires when an entity is removed from the game (for example, unloaded, or a few seconds after they are dead.)

    EntityRemoveBeforeEvent

    Data for an event that happens when an entity is being removed from the world (for example, the entity is unloaded because it is not close to players.)

    EntityRemoveBeforeEventSignal

    Allows registration for an event that fires when an entity is being removed from the game (for example, unloaded, or a few seconds after they are dead.)

    EntityRideableComponent

    When added, this component adds the capability that an entity can be ridden by another entity.

    EntityRidingComponent

    This component is added to any entity when it is riding another entity.

    EntityScaleComponent

    Sets the entity's visual size.

    EntitySkinIdComponent

    Skin Id value. Can be used to differentiate skins, such as base skins for villagers.

    EntitySpawnAfterEvent

    Contains data related to an entity spawning within the world.

    EntitySpawnAfterEventSignal

    Registers a script-based event handler for handling what happens when an entity spawns.

    EntityStrengthComponent

    Defines the entity's ability to carry items. An entity with a higher strength would have higher potential carry capacity and more item slots.

    EntityTameableComponent

    Defines the rules for an entity to be tamed by the player.

    EntityTameMountComponent

    Contains options for taming a rideable entity based on the entity that mounts it.

    EntityType

    Represents information about a type of entity.

    EntityTypeFamilyComponent

    Base class for downstream entity components.

    EntityTypes

    Used for accessing all entity types currently available for use within the world.

    EntityUnderwaterMovementComponent

    Defines the general movement speed underwater of this entity.

    EntityVariantComponent

    Used to differentiate the component group of a variant of an entity from others. (e.g. ocelot, villager).

    EntityWantsJockeyComponent

    When added, this component signifies that this entity wants to become a jockey.

    ExplosionAfterEvent

    Contains information regarding an explosion that has happened.

    ExplosionAfterEventSignal

    Manages callbacks that are connected to when an explosion occurs.

    ExplosionBeforeEvent

    Contains information regarding an explosion that has happened.

    ExplosionBeforeEventSignal

    Manages callbacks that are connected to before an explosion occurs.

    FeedItem

    As part of the Healable component, represents a specific item that can be fed to an entity to cause health effects.

    FeedItemEffect

    Represents an effect that is applied as a result of a food item being fed to an entity.

    FluidContainer

    Represents constants related to fluid containers.

    GameRuleChangeAfterEvent

    Contains information regarding a changed world.gameRules property.

    GameRuleChangeAfterEventSignal

    Manages callbacks that are connected to when a world.gameRules property has changed.

    GameRules

    Represents the game rules for a world experience.

    InputInfo

    Contains the input information for a client instance.

    InvalidContainerError
    InvalidContainerSlotError

    The container slot is invalid. This can occur when the owning container is destroyed or unloaded.

    InvalidEntityError

    The error called when an entity is invalid. This can occur when accessing components on a removed entity.

    InvalidIteratorError
    InvalidStructureError

    Thrown when a Structure is invalid. A structure becomes invalid when it is deleted.

    ItemCompleteUseAfterEvent

    Contains information related to a chargeable item completing being charged.

    ItemCompleteUseAfterEventSignal

    Manages callbacks that are connected to the completion of charging for a chargeable item.

    ItemCompleteUseEvent

    Contains information related to a chargeable item completing being charged.

    ItemComponent

    Base class for item components.

    ItemComponentBeforeDurabilityDamageEvent

    Contains information regarding an item before it is damaged from hitting an entity.

    ItemComponentCompleteUseEvent

    Contains information related to a chargeable item completing being charged via a component.

    ItemComponentConsumeEvent

    Contains information related to a food item being consumed.

    ItemComponentHitEntityEvent

    Contains information regarding when an item is used to hit an entity.

    ItemComponentMineBlockEvent

    Contains information regarding the mining of a block using an item.

    ItemComponentRegistry

    Provides the functionality for registering custom components for items.

    ItemComponentUseEvent

    Contains information regarding the use of an item.

    ItemComponentUseOnEvent

    Contains information regarding the use of an item on a block via a component.

    ItemCompostableComponent

    When present, the item can be composted in the composter block if the composting chance is in the range [1 - 100].

    ItemCooldownComponent

    When present on an item, this item has a cooldown effect when used by entities.

    ItemCustomComponentAlreadyRegisteredError

    Thrown when trying to register an item custom component with a name that has already been registered.

    ItemCustomComponentInstance

    An instance of a custom component on an item.

    ItemCustomComponentReloadNewComponentError

    Thrown after using the /reload command when trying to register a previously unregistered item custom component.

    ItemCustomComponentReloadNewEventError

    Thrown after using the /reload command when trying to register a previously registered item custom component that handles a new event.

    ItemCustomComponentReloadVersionError

    Thrown after using the /reload command when trying to register a previously registered item custom component with a newer API version.

    ItemDurabilityComponent

    When present on an item, this item can take damage in the process of being used. Note that this component only applies to data-driven items.

    ItemDyeableComponent

    When present on an item, this item can be dyed.

    ItemEnchantableComponent

    When present on an item, this item can have enchantments applied to it.

    ItemFoodComponent

    When present on an item, this item is consumable by entities. Note that this component only applies to data-driven items.

    ItemInventoryComponent

    This component is added to items with the Storage Item component. Can access and modify this items inventory container.

    ItemPotionComponent

    When present on an item, this item is a potion item.

    ItemReleaseUseAfterEvent

    Contains information related to a chargeable item when the player has finished using the item and released the build action.

    ItemReleaseUseAfterEventSignal

    Manages callbacks that are connected to the releasing of charging for a chargeable item.

    ItemStack

    Defines a collection of items.

    ItemStartUseAfterEvent

    Contains information related to a chargeable item starting to be charged.

    ItemStartUseAfterEventSignal

    Manages callbacks that are connected to the start of charging for a chargeable item.

    ItemStartUseOnAfterEvent

    Contains information related to an item being used on a block. This event fires when a player presses the the Use Item / Place Block button to successfully use an item or place a block. Fires for the first block that is interacted with when performing a build action. Note: This event cannot be used with Hoe or Axe items.

    ItemStartUseOnAfterEventSignal

    Manages callbacks that are connected to an item starting being used on a block event.

    ItemStopUseAfterEvent

    Contains information related to a chargeable item has finished an items use cycle, or when the player has released the use action with the item.

    ItemStopUseAfterEventSignal

    Manages callbacks that are connected to the stopping of charging for an item that has a registered minecraft:chargeable component.

    ItemStopUseOnAfterEvent

    Contains information related to an item that has stopped being used on a block. This event fires when a player successfully uses an item or places a block by pressing the Use Item / Place Block button. If multiple blocks are placed, this event will only occur once at the beginning of the block placement. Note: This event cannot be used with Hoe or Axe items.

    ItemStopUseOnAfterEventSignal

    Manages callbacks that are connected to an item stops used on a block event.

    ItemType

    Represents the type of an item - for example, Wool.

    ItemTypes

    Returns the set of item types registered within Minecraft.

    ItemUseAfterEvent

    Contains information related to an item being used on a block. This event fires when an item used by a player successfully triggers an entity interaction.

    ItemUseAfterEventSignal

    Manages callbacks that are connected to an item use event.

    ItemUseBeforeEvent

    Contains information related to an item being used.

    ItemUseBeforeEventSignal

    Manages callbacks that fire before an item is used.

    ItemUseOnEvent

    Contains information regarding the use of an item on a block.

    LeverActionAfterEvent

    Contains information related to changes to a lever activating or deactivating.

    LeverActionAfterEventSignal

    Manages callbacks that are connected to lever moves (activates or deactivates).

    ListBlockVolume

    Volume composed of an unordered container of unique block locations.

    LocationInUnloadedChunkError

    Thrown when the chunk for provided location or bounding area is not loaded.

    LocationOutOfWorldBoundariesError

    Thrown when a provided location or bounding area is outside the minimum or maximum dimension height.

    MessageReceiveAfterEvent

    A specific currently-internal event used for passing messages from client to server.

    MolangVariableMap

    Contains a set of additional variable values for further defining how rendering and animations function.

    NamespaceNameError

    Thrown when a name requires a namespace and an error occurs when validating that namespace

    PistonActivateAfterEvent

    Contains information related to changes to a piston expanding or retracting.

    PistonActivateAfterEventSignal

    Manages callbacks that are connected to piston activations.

    PlaceJigsawError
    Player

    Represents a player within the world.

    PlayerAimAssist

    A container for APIs related to player aim-assist.

    PlayerBreakBlockAfterEvent

    Contains information regarding an event after a player breaks a block.

    PlayerBreakBlockAfterEventSignal

    Manages callbacks that are connected to when a player breaks a block.

    PlayerBreakBlockBeforeEvent

    Contains information regarding an event before a player breaks a block.

    PlayerBreakBlockBeforeEventSignal

    Manages callbacks that are connected to before a player breaks a block.

    PlayerButtonInputAfterEvent

    Event data for when a player presses a button.

    PlayerButtonInputAfterEventSignal

    Manages callbacks that are connected to player inputs.

    PlayerCursorInventoryComponent

    Represents the players cursor inventory. Used when moving items between between containers in the inventory UI. Not used with touch controls.

    PlayerDimensionChangeAfterEvent

    Contains information related to changes to a player's dimension having been changed.

    PlayerDimensionChangeAfterEventSignal

    Manages callbacks that are connected to successful player dimension changes.

    PlayerEmoteAfterEvent
    PlayerEmoteAfterEventSignal
    PlayerGameModeChangeAfterEvent

    Contains information regarding an event after a players game mode is changed.

    PlayerGameModeChangeAfterEventSignal

    Manages callbacks that are connected to after a players game mode is changed.

    PlayerGameModeChangeBeforeEvent

    Contains information regarding an event before a player interacts with an entity.

    PlayerGameModeChangeBeforeEventSignal

    Manages callbacks that are connected to before a players game mode is changed.

    PlayerHotbarSelectedSlotChangeAfterEvent

    Contains information regarding an event after changing the selected hotbar slot for a player.

    PlayerHotbarSelectedSlotChangeAfterEventSignal

    Manages callbacks that are connected after a player selected hotbar slot is changed.

    PlayerInputModeChangeAfterEvent

    Event data for when a player input mode changes.

    PlayerInputModeChangeAfterEventSignal

    Manages callbacks that are connected to player input mode.

    PlayerInputPermissionCategoryChangeAfterEvent

    Contains information regarding an event after a players input permissions change.

    PlayerInputPermissionCategoryChangeAfterEventSignal

    Manages callbacks that are connected to after a players input permissions change.

    PlayerInputPermissions

    Contains APIs to enable/disable player input permissions.

    PlayerInteractWithBlockAfterEvent

    Contains information regarding an event after a player successfully interacts with a block.

    PlayerInteractWithBlockAfterEventSignal

    Manages callbacks that are connected to after a player interacts with a block.

    PlayerInteractWithBlockBeforeEvent

    Contains information regarding an event before a player interacts with a block.

    PlayerInteractWithBlockBeforeEventSignal

    Manages callbacks that are connected to before a player interacts with a block.

    PlayerInteractWithEntityAfterEvent

    Contains information regarding an event after a player successfully interacts with an entity.

    PlayerInteractWithEntityAfterEventSignal

    Manages callbacks that are connected to after a player interacts with an entity.

    PlayerInteractWithEntityBeforeEvent

    Contains information regarding an event before a player interacts with an entity.

    PlayerInteractWithEntityBeforeEventSignal

    Manages callbacks that are connected to before a player interacts with an entity.

    PlayerInventoryItemChangeAfterEvent

    Contains information regarding an event after a player's inventory item changes.

    PlayerInventoryItemChangeAfterEventSignal

    Manages callbacks that are connected after a player's inventory item is changed.

    PlayerJoinAfterEvent

    Contains information regarding a player that has joined. See the playerSpawn event for more detailed information that could be returned after the first time a player has spawned within the game.

    PlayerJoinAfterEventSignal

    Manages callbacks that are connected to a player joining the world.

    PlayerLeaveAfterEvent

    Contains information regarding a player that has left the world.

    PlayerLeaveAfterEventSignal

    Manages callbacks that are connected to a player leaving the world.

    PlayerLeaveBeforeEvent

    Contains information regarding a player that is leaving the world.

    PlayerLeaveBeforeEventSignal

    Manages callbacks that are connected to a player leaving the world.

    PlayerPlaceBlockAfterEvent

    Contains information regarding an event where a player places a block.

    PlayerPlaceBlockAfterEventSignal

    Manages callbacks that are connected to when a block is placed by a player.

    PlayerPlaceBlockBeforeEvent

    Contains information regarding an event before a player places a block.

    PlayerPlaceBlockBeforeEventSignal

    Manages callbacks that are connected to before a block is placed by a player.

    PlayerSpawnAfterEvent

    An event that contains more information about a player spawning.

    PlayerSpawnAfterEventSignal

    Registers an event when a player is spawned (or re-spawned after death) and fully ready within the world.

    PotionEffectType

    Represents a type of potion effect - like healing or leaping

    • that can be used with PotionOptions.
    PotionLiquidType

    Represents a type of potion liquid - like splash, or lingering - that can be used with PotionOptions.

    PotionModifierType

    Represents a type of potion modifier - like strong, or long

    • that can be used with PotionOptions.
    Potions

    Used for accessing all potion effects, liquids, and modifiers currently available for use within the world.

    PressurePlatePopAfterEvent

    Contains information related to changes to a pressure plate pop.

    PressurePlatePopAfterEventSignal

    Manages callbacks that are connected to when a pressure plate is popped.

    PressurePlatePushAfterEvent

    Contains information related to changes to a pressure plate push.

    PressurePlatePushAfterEventSignal

    Manages callbacks that are connected to when a pressure plate is pushed.

    ProjectileHitBlockAfterEvent

    Contains information related to a projectile hitting a block.

    ProjectileHitBlockAfterEventSignal

    Manages callbacks that are connected to when a projectile hits a block.

    ProjectileHitEntityAfterEvent

    Contains information related to a projectile hitting an entity.

    ProjectileHitEntityAfterEventSignal

    Manages callbacks that are connected to when a projectile hits an entity.

    RawMessageError
    Scoreboard

    Contains objectives and participants for the scoreboard.

    ScoreboardIdentity

    Contains an identity of the scoreboard item.

    ScoreboardObjective

    Contains objectives and participants for the scoreboard.

    ScoreboardScoreInfo

    Contains a pair of a scoreboard participant and its respective score.

    ScreenDisplay

    Contains information about user interface elements that are showing up on the screen.

    ScriptEventCommandMessageAfterEvent

    Returns additional data about a /scriptevent command invocation.

    ScriptEventCommandMessageAfterEventSignal

    Allows for registering an event handler that responds to inbound /scriptevent commands.

    Seat

    Describes a particular seating position on this rideable entity.

    ServerMessageAfterEventSignal

    Manages callbacks that are message passing to a server. This event is not currently fully implemented, and should not be used.

    ShutdownBeforeEventSignal

    Provides an adaptable interface for callers to subscribe to an event that fires before the game world shuts down. This event occurs after players have left, but before the world has closed.

    ShutdownEvent

    The event object that gets dispatched when the game world is shutting down.

    StartupBeforeEventSignal
    StartupEvent
    Structure

    Represents a loaded structure template (.mcstructure file). Structures can be placed in a world using the /structure command or the StructureManager APIs.

    StructureManager

    Manager for Structure related APIs. Includes APIs for creating, getting, placing and deleting Structures.

    System

    A class that provides system-level events and functions.

    SystemAfterEvents

    Provides a set of events that fire within the broader scripting system within Minecraft.

    SystemBeforeEvents

    A set of events that fire before an actual action occurs. In most cases, you can potentially cancel or modify the impending event. Note that in before events any APIs that modify gameplay state will not function and will throw an error.

    SystemInfo

    Contains device information, like memory tier.

    TargetBlockHitAfterEvent

    Contains information related to changes to a target block hit.

    TargetBlockHitAfterEventSignal

    Manages callbacks that are connected to when a target block is hit.

    Trigger

    Represents a trigger for firing an event.

    TripWireTripAfterEvent

    Contains information related to changes to a trip wire trip.

    TripWireTripAfterEventSignal

    Manages callbacks that are connected to when a trip wire is tripped.

    UnloadedChunksError

    Error thrown when the specified area contains one or more unloaded chunks.

    WatchdogTerminateBeforeEvent

    Contains information related to a script watchdog termination.

    WatchdogTerminateBeforeEventSignal

    Manages callbacks that are connected to a callback that will be called when a script runtime is being terminated due to a violation of the performance watchdog system.

    WeatherChangeAfterEvent

    Contains information related to changes in weather in the environment.

    WeatherChangeAfterEventSignal

    Manages callbacks that are connected to weather changing.

    WeatherChangeBeforeEvent

    Contains information related to changes in weather in the environment.

    WeatherChangeBeforeEventSignal

    Manages callbacks that are connected to before weather changing.

    World

    A class that wraps the state of a world - a set of dimensions and the environment of Minecraft.

    WorldAfterEvents

    Contains a set of events that are available across the scope of the World.

    WorldBeforeEvents

    A set of events that fire before an actual action occurs. In most cases, you can potentially cancel or modify the impending event. Note that in before events any APIs that modify gameplay state will not function and will throw an error. (e.g., dimension.spawnEntity)

    WorldLoadAfterEvent
    WorldLoadAfterEventSignal

    Interfaces

    BiomeSearchOptions

    Contains additional options for searches for the dimension.findNearestBiome API.

    BlockBoundingBox

    A BlockBoundingBox is an interface to an object which represents an AABB aligned rectangle. The BlockBoundingBox assumes that it was created in a valid state (min <= max) but cannot guarantee it (unless it was created using the associated BlockBoundingBoxUtils utility functions. The min/max coordinates represent the diametrically opposite corners of the rectangle. The BlockBoundingBox is not a representation of blocks - it has no association with any type, it is just a mathematical construct - so a rectangle with ( 0,0,0 ) -> ( 0,0,0 ) has a size of ( 0,0,0 ) (unlike the very similar BlockVolume object)

    BlockCustomComponent

    Contains a set of events that will be raised for a block. This object must be bound using the BlockRegistry.

    BlockEventOptions

    Contains optional parameters for registering a block event.

    BlockFillOptions

    Contains additional options for a block fill operation.

    BlockFilter

    Options to include or exclude blocks based on type, tag or permutation. If no include options are added it will select all blocks that are not rejected by the exclude options. If at least one include option is added the block must match one of the include options to not be rejected.

    BlockHitInformation

    Contains more information for events where a block is hit.

    BlockRaycastHit

    Contains information for block raycast hit results.

    BlockRaycastOptions

    Contains additional options for configuring a block raycast query.

    CameraEaseOptions

    Contains options associated with a camera ease operation.

    CameraFadeOptions

    Used to initiate a full-screen color fade.

    CameraFadeTimeOptions

    Contains timings for a fade transition.

    CameraFixedBoomOptions

    Options to control pivot points and offsets of the third person boom preset.

    CameraSetFacingOptions
    CameraSetLocationOptions
    CameraSetPosOptions
    CameraSetRotOptions
    CameraTargetOptions

    Used to target an entity with a free camera.

    CompoundBlockVolumeItem

    This interface defines an entry into the CompoundBlockVolume which represents a volume of positive or negative space.

    ContainerRules

    Rules that if broken on container operations will throw an error.

    CustomCommand

    Define the custom command, including name, permissions, and parameters.

    CustomCommandParameter

    Definition for each parameter expected by the custom command.

    CustomCommandResult

    Interface returned from custom command callback function.

    DefinitionModifier

    Contains a set of updates to the component definition state of an entity.

    DimensionLocation

    An exact coordinate within the world, including its dimension and location.

    Enchantment

    This interface represents a specific leveled enchantment that is applied to an item.

    EntityApplyDamageByProjectileOptions

    Additional options for when damage has been applied via a projectile.

    EntityApplyDamageOptions

    Additional descriptions and metadata for a damage event.

    EntityDamageSource

    Provides information about how damage has been applied to an entity.

    EntityDataDrivenTriggerEventOptions

    Specifies additional filters that are used in registering a data driven trigger event for entities.

    EntityEffectOptions

    Contains additional options for entity effects.

    EntityEventOptions

    Contains optional parameters for registering an entity event.

    EntityFilter

    Contains options for filtering entities.

    EntityHitInformation

    Contains additional information about an entity that was hit.

    EntityQueryOptions

    Contains options for selecting entities within an area.

    EntityQueryPropertyOptions
    EntityQueryScoreOptions

    Contains additional options for filtering players based on their score for an objective.

    EntityRaycastHit

    Contains information for entity raycast hit results.

    EntityRaycastOptions

    Contains additional options for an entity raycast operation.

    EqualsComparison

    Equal to operator.

    ExplosionOptions

    Additional configuration options for the Dimension.createExplosion method.

    GreaterThanComparison

    Greater than operator.

    GreaterThanOrEqualsComparison

    Greater than or equal to operator.

    HotbarEventOptions

    Contains additional filtering options for hotbar events.

    InputEventOptions

    An interface that is passed into @minecraft/Server.PlayerButtonInputAfterEventSignal.subscribe that filters out which events are passed to the provided callback.

    InventoryItemEventOptions

    Contains additional filtering options for inventory item events.

    ItemCustomComponent

    Contains a set of events that will be raised for an item. This object must be bound using the ItemComponentRegistry.

    JigsawPlaceOptions

    Provides additional options for StructureManager.placeJigsaw.

    JigsawStructurePlaceOptions

    Provides additional options for StructureManager.placeJigsawStructure.

    LessThanComparison

    Less than operator.

    LessThanOrEqualsComparison

    Less than or equal to operator.

    MusicOptions

    Additional configuration options for World.playMusic/World.queueMusic methods.

    NotEqualsComparison

    Not equal to operator.

    PlayAnimationOptions

    Contains additional options for how an animation is played.

    PlayerAimAssistSettings

    Settings relating to a player's aim-assist targeting.

    PlayerSoundOptions

    Additional options for how a sound plays for a player.

    PotionOptions

    Options for use in creating potions. See ItemStack.createPotion.

    ProjectileShootOptions

    Optional arguments for @minecraft/server.EntityProjectileComponent.shoot.

    RangeComparison

    Operator represents a lower/upper bound structure for expressing a potential range of numbers.

    RawMessage

    Defines a JSON structure that is used for more flexible.

    RawMessageScore

    Provides a description of a score token to use within a raw message.

    RawText

    A RawMessage with only the rawtext property. When a RawMessage is serialized the contents are put into a rawtext property, so this is useful when reading saved RawMessages. See BlockSignComponent.setText and BlockSignComponent.getRawText for examples.

    RGB

    Represents a fully customizable color within Minecraft.

    RGBA

    Represents a fully customizable color within Minecraft.

    ScoreboardObjectiveDisplayOptions

    Contains additional options for how a scoreboard should be displayed within its display slot.

    ScriptEventMessageFilterOptions

    Contains additional options for registering a script event event callback.

    SpawnEntityOptions

    Contains additional options for spawning an Entity.

    StructureCreateOptions

    Provides additional options for StructureManager.createFromWorld

    StructurePlaceOptions

    Provides additional options for StructureManager.place

    TeleportOptions

    Contains additional options for teleporting an entity.

    TitleDisplayOptions

    Contains additional options for displaying a title and optional subtitle.

    Vector2

    Represents a two-directional vector.

    Vector3

    Contains a description of a vector.

    VectorXZ
    WorldSoundOptions

    Contains additional options for a playSound occurrence.

    Type Aliases

    BlockComponentReturnType
    BlockComponentTypeMap
    BlockStateArg

    Type alias used by the BlockPermutation matches and resolve functions to narrow block state argument types to those mapped by @minecraft/vanilla-data.BlockStateMapping.

    EntityComponentReturnType
    EntityComponentTypeMap
    EntityIdentifierType
    ItemComponentReturnType
    ItemComponentTypeMap
    VanillaEntityIdentifier

    Variables

    HudElementsCount
    HudVisibilityCount
    MoonPhaseCount
    system
    TicksPerDay
    TicksPerSecond
    world