# Python API — Minecraft 1.20.1

> Agent-readable Python API pages in the website's generated sidebar order.

## Overview

- [Python API](/minecraft/1.20.1/api/python/index.md): This reference is generated from types.pyi. Public member names use the snakecase Python projection of QuestScript's shared semantic API.

## Classes

- [BlockVolume](/minecraft/1.20.1/api/python/classes/BlockVolume.md): Immutable inclusive block volume.
- [ItemStack](/minecraft/1.20.1/api/python/classes/ItemStack.md): A detached, mutable item stack value owned by QuestScript.

## Protocols

- [Block](/minecraft/1.20.1/api/python/protocols/Block.md): A live block at a fixed location in a dimension.
- [BlockFillOperation](/minecraft/1.20.1/api/python/protocols/BlockFillOperation.md): A cooperative block-fill operation.
- [BlockPermutation](/minecraft/1.20.1/api/python/protocols/BlockPermutation.md): An immutable detached block type and its complete registered state values.
- [BlockStates](/minecraft/1.20.1/api/python/protocols/BlockStates.md): Bounded catalog of Java Edition block property definitions.
- [BlockStateType](/minecraft/1.20.1/api/python/protocols/BlockStateType.md): An immutable QuestScript-owned block-state definition.
- [BlockType](/minecraft/1.20.1/api/python/protocols/BlockType.md): An immutable QuestScript-owned block type value.
- [BlockTypes](/minecraft/1.20.1/api/python/protocols/BlockTypes.md): Bounded catalog of registered block types.
- [BlockVector3](/minecraft/1.20.1/api/python/protocols/BlockVector3.md): A mutable numeric vector produced from an integer block position.
- [BrokenBlockPermutation](/minecraft/1.20.1/api/python/protocols/BrokenBlockPermutation.md): Block permutation captured for a block-break event.
- [BulkOperation](/minecraft/1.20.1/api/python/protocols/BulkOperation.md): Cancelable Script-owned handle for cooperative bounded work.
- [BulkOperationCompletion](/minecraft/1.20.1/api/python/protocols/BulkOperationCompletion.md): Immutable terminal outcome for one bounded bulk operation.
- [BulkOperationProgress](/minecraft/1.20.1/api/python/protocols/BulkOperationProgress.md): Immutable progress snapshot for one bounded bulk operation.
- [CapabilityDeniedError](/minecraft/1.20.1/api/python/protocols/CapabilityDeniedError.md): Stable catchable error raised when a Script operation lacks effective capability authority.
- [Dimension](/minecraft/1.20.1/api/python/protocols/Dimension.md): A live Minecraft dimension exposed through a QuestScript-owned facade.
- [Entity](/minecraft/1.20.1/api/python/protocols/Entity.md): A live Minecraft entity exposed through a QuestScript-owned facade.
- [EntityHurtBeforeEvent](/minecraft/1.20.1/api/python/protocols/EntityHurtBeforeEvent.md): Cancelable event fired before damage is applied to an entity.
- [EntityHurtBeforeEventSignal](/minecraft/1.20.1/api/python/protocols/EntityHurtBeforeEventSignal.md): Related API: EntityHurtBeforeEvent
- [Equipment](/minecraft/1.20.1/api/python/protocols/Equipment.md): Mutable equipment slots of one player.
- [FillBlocksResult](/minecraft/1.20.1/api/python/protocols/FillBlocksResult.md): Temporary bounded result for synchronous block fill until ListBlockVolume is implemented.
- [InventoryLease](/minecraft/1.20.1/api/python/protocols/InventoryLease.md): Recoverable ownership of one player's temporary inventory replacement.
- [InventoryLeaseRegistry](/minecraft/1.20.1/api/python/protocols/InventoryLeaseRegistry.md): Registry of unfinished inventory leases owned by the current Script.
- [InventorySnapshot](/minecraft/1.20.1/api/python/protocols/InventorySnapshot.md): Detached player inventory state captured by PlayerInventory.capture.
- [LegacyBlockResult](/minecraft/1.20.1/api/python/protocols/LegacyBlockResult.md): Deprecated synchronous result returned by minecraft.getblock.
- [LegacyGameRules](/minecraft/1.20.1/api/python/protocols/LegacyGameRules.md)
- [Minecraft](/minecraft/1.20.1/api/python/protocols/Minecraft.md): Deprecated pre-release Minecraft API object.
- [Player](/minecraft/1.20.1/api/python/protocols/Player.md): A live server player with inventory and messaging APIs.
- [PlayerBreakBlockAfterEvent](/minecraft/1.20.1/api/python/protocols/PlayerBreakBlockAfterEvent.md): Event fired after a player successfully breaks a block.
- [PlayerBreakBlockAfterEventSignal](/minecraft/1.20.1/api/python/protocols/PlayerBreakBlockAfterEventSignal.md): Related API: PlayerBreakBlockAfterEvent
- [PlayerBreakBlockBeforeEvent](/minecraft/1.20.1/api/python/protocols/PlayerBreakBlockBeforeEvent.md): Cancelable event fired before a player breaks a block.
- [PlayerBreakBlockBeforeEventSignal](/minecraft/1.20.1/api/python/protocols/PlayerBreakBlockBeforeEventSignal.md): Related API: PlayerBreakBlockBeforeEvent
- [PlayerInventory](/minecraft/1.20.1/api/python/protocols/PlayerInventory.md): Mutable main inventory of one player.
- [PlayerJoinAfterEvent](/minecraft/1.20.1/api/python/protocols/PlayerJoinAfterEvent.md): Event fired after a player becomes available to the server.
- [PlayerJoinAfterEventSignal](/minecraft/1.20.1/api/python/protocols/PlayerJoinAfterEventSignal.md): Related API: PlayerJoinAfterEvent
- [PlayerLeaveAfterEvent](/minecraft/1.20.1/api/python/protocols/PlayerLeaveAfterEvent.md): Event fired after a player leaves the server.
- [PlayerLeaveAfterEventSignal](/minecraft/1.20.1/api/python/protocols/PlayerLeaveAfterEventSignal.md): Related API: PlayerLeaveAfterEvent
- [QuotaExceededError](/minecraft/1.20.1/api/python/protocols/QuotaExceededError.md): Stable catchable error raised before a Script operation exceeds its effective resource quota.
- [RunCommandResult](/minecraft/1.20.1/api/python/protocols/RunCommandResult.md): Result of an administrative command execution.
- [ScriptCapabilities](/minecraft/1.20.1/api/python/protocols/ScriptCapabilities.md): Read-only effective capability view for the current Script Run.
- [ScriptEventReceiveEvent](/minecraft/1.20.1/api/python/protocols/ScriptEventReceiveEvent.md): Data delivered for one received /scriptevent message.
- [ScriptEventReceiveEventSignal](/minecraft/1.20.1/api/python/protocols/ScriptEventReceiveEventSignal.md): Related API: ScriptEventReceiveEvent
- [ScriptExports](/minecraft/1.20.1/api/python/protocols/ScriptExports.md): Frozen callable registry published by one exact loaded Script Run.
- [ScriptHost](/minecraft/1.20.1/api/python/protocols/ScriptHost.md): Global used to publish callables for other Scripts.
- [ScriptLimits](/minecraft/1.20.1/api/python/protocols/ScriptLimits.md): Read-only effective security-limit view for the current Script Run.
- [ScriptStorage](/minecraft/1.20.1/api/python/protocols/ScriptStorage.md): Persistent storage bounded by questscript:maxstoragekeys, maxstoragekeybytes, maxstoragestringbytes, maxstoragevaluedepth, maxstoragecollectionentries, maxstoragevaluebytes, and maxstoragebytes.
- [ScriptUnloadBeforeEvent](/minecraft/1.20.1/api/python/protocols/ScriptUnloadBeforeEvent.md): Data supplied to the final synchronous Script unload event.
- [ScriptUnloadBeforeEventSignal](/minecraft/1.20.1/api/python/protocols/ScriptUnloadBeforeEventSignal.md): Related API: ScriptUnloadBeforeEvent
- [System](/minecraft/1.20.1/api/python/protocols/System.md): Scheduler in QuestScript's final server-thread scripting phase.
- [SystemAfterEvents](/minecraft/1.20.1/api/python/protocols/SystemAfterEvents.md): Observational system event streams.
- [SystemBeforeEvents](/minecraft/1.20.1/api/python/protocols/SystemBeforeEvents.md): Synchronous lifecycle events fired before teardown completes.
- [TriggerEntityEvent](/minecraft/1.20.1/api/python/protocols/TriggerEntityEvent.md): Player membership change emitted by a trigger volume.
- [TriggerSignal](/minecraft/1.20.1/api/python/protocols/TriggerSignal.md): Subscription surface for one trigger-volume event kind.
- [TriggerTickEvent](/minecraft/1.20.1/api/python/protocols/TriggerTickEvent.md): Periodic membership snapshot emitted by a trigger volume.
- [TriggerVolume](/minecraft/1.20.1/api/python/protocols/TriggerVolume.md): A Script-Owned, tick-sampled trigger over an inclusive block volume.
- [TriggerVolumeAfterEvents](/minecraft/1.20.1/api/python/protocols/TriggerVolumeAfterEvents.md): Event streams emitted by a trigger volume.
- [Vector3](/minecraft/1.20.1/api/python/protocols/Vector3.md): A three-dimensional coordinate or direction.
- [World](/minecraft/1.20.1/api/python/protocols/World.md): Main QuestScript-owned entry point for world access and Script state.
- [WorldAfterEvents](/minecraft/1.20.1/api/python/protocols/WorldAfterEvents.md): Observational world event streams fired after their actions.
- [WorldBeforeEvents](/minecraft/1.20.1/api/python/protocols/WorldBeforeEvents.md): Synchronous, cancelable world event streams.

## Typed Dictionaries

- [EntityQueryOptions](/minecraft/1.20.1/api/python/typed-dicts/EntityQueryOptions.md): Filters supported by entity and player queries.
- [FillBlocksAsyncOptions](/minecraft/1.20.1/api/python/typed-dicts/FillBlocksAsyncOptions.md): Limits applied to one cooperative fill operation.
- [FillBlocksOptions](/minecraft/1.20.1/api/python/typed-dicts/FillBlocksOptions.md): Limits applied to one synchronous fill operation.
- [InventoryLeaseOptions](/minecraft/1.20.1/api/python/typed-dicts/InventoryLeaseOptions.md): Options for a temporary inventory replacement lease.
- [InventoryLoadout](/minecraft/1.20.1/api/python/typed-dicts/InventoryLoadout.md): Player inventory, equipment, and selected slot applied as one loadout.
- [InventorySnapshotOptions](/minecraft/1.20.1/api/python/typed-dicts/InventorySnapshotOptions.md): Selects optional player state captured in an inventory snapshot.
- [ScriptEventOptions](/minecraft/1.20.1/api/python/typed-dicts/ScriptEventOptions.md): Filters applied to a Script Event subscription.
- [ScriptExportOptions](/minecraft/1.20.1/api/python/typed-dicts/ScriptExportOptions.md): Metadata attached to an explicitly registered Script Export.
- [TeleportOptions](/minecraft/1.20.1/api/python/typed-dicts/TeleportOptions.md): Options that control an entity teleport.
- [TriggerVolumeOptions](/minecraft/1.20.1/api/python/typed-dicts/TriggerVolumeOptions.md): Options used to create a Script-Owned trigger volume.
- [Vector3Mapping](/minecraft/1.20.1/api/python/typed-dicts/Vector3Mapping.md): Mapping form of a three-dimensional coordinate.

## Type Aliases

- [BlockStateValue](/minecraft/1.20.1/api/python/type-aliases/BlockStateValue.md): A boolean, integer, or enum-like string stored by a block-state property.
- [DamageCause](/minecraft/1.20.1/api/python/type-aliases/DamageCause.md): A normalized cause reported by the current entity-hurt event surface.
- [DataValue](/minecraft/1.20.1/api/python/type-aliases/DataValue.md): A non-null value that Script Storage and item data can persist.
- [DimensionInput](/minecraft/1.20.1/api/python/type-aliases/DimensionInput.md): Related API: Dimension
- [EntityOrLocationInput](/minecraft/1.20.1/api/python/type-aliases/EntityOrLocationInput.md): Related API: Entity, Vector3Like
- [EquipmentSlot](/minecraft/1.20.1/api/python/type-aliases/EquipmentSlot.md): An equipment slot exposed by the QuestScript equipment facade.
- [GameMode](/minecraft/1.20.1/api/python/type-aliases/GameMode.md): A player game mode understood by Java Edition.
- [InventoryLeaseState](/minecraft/1.20.1/api/python/type-aliases/InventoryLeaseState.md): Lifecycle state of a temporary inventory lease.
- [InventoryLeaseUnloadPolicy](/minecraft/1.20.1/api/python/type-aliases/InventoryLeaseUnloadPolicy.md): Action taken for an unfinished inventory lease when its Script unloads.
- [ScriptEventId](/minecraft/1.20.1/api/python/type-aliases/ScriptEventId.md): Explicit author-chosen : Script Event message ID.
- [ScriptEventSource](/minecraft/1.20.1/api/python/type-aliases/ScriptEventSource.md)
- [ScriptExportDeprecation](/minecraft/1.20.1/api/python/type-aliases/ScriptExportDeprecation.md)
- [ScriptUnloadReason](/minecraft/1.20.1/api/python/type-aliases/ScriptUnloadReason.md): Reason supplied during one Script Run's synchronous unload phase.
- [Vector3Dto](/minecraft/1.20.1/api/python/type-aliases/Vector3Dto.md)
- [Vector3Like](/minecraft/1.20.1/api/python/type-aliases/Vector3Like.md): A vector facade, vector-shaped mapping, or three-element tuple.

## Variables

- [import_script](/minecraft/1.20.1/api/python/variables/import_script.md): Return the frozen exports of an already loaded Script.
- [minecraft](/minecraft/1.20.1/api/python/variables/minecraft.md): Deprecated low-level Minecraft API object.
- [script](/minecraft/1.20.1/api/python/variables/script.md): Explicit cross-Script export registrar for the current Script Run.
- [system](/minecraft/1.20.1/api/python/variables/system.md): Tick scheduling and system events for the current Script Run.
- [world](/minecraft/1.20.1/api/python/variables/world.md): Main QuestScript-owned world API for the current Script Run.
