import { type GAMERULES, type JSONTextComponent, type Score, SelectorClass } from "sandstone"; import type { ATTRIBUTES, BLOCKS, ENTITY_TYPES, ITEMS } from "sandstone/arguments/generated"; import type { LiteralStringUnion } from "./utils"; export type TargetNames = LiteralStringUnion<"all" | "self"> | SelectorClass; export declare function mapTarget(target: string | SelectorClass): SelectorClass | string; export declare const Actions: { /** * Send a chat message to everyone. * @param {JSONTextComponent} message - The message to send. */ announce: ({ message }: { message: JSONTextComponent; }) => void; /** * Clear the inventory of a target. * @param {TargetNames} target - The target to clear the inventory of. */ clear: ({ target }: { target: TargetNames; }) => void; /** * Custom action allowing to run any Sandstone command. * * @param {() => void} callback - The function to execute. */ custom: (callback: () => void) => void; /** * Fill a region with a block. * @param {BLOCKS} block - The block to fill the region with. * @param {number} x1 - The x coordinate of the region. * @param {number} y1 - The y coordinate of the region. * @param {number} z1 - The z coordinate of the region. * @param {number} x2 - The x coordinate of the region. * @param {number} y2 - The y coordinate of the region. * @param {number} z2 - The z coordinate of the region. * @param {boolean} absolute - Whether the coordinates are absolute or relative. */ fill: ({ block, x1, y1, z1, x2, y2, z2, absolute, mode, }: { block: BLOCKS; x1: number; y1: number; z1: number; x2: number; y2: number; z2: number; absolute: boolean; mode: "fill" | "line" | "pyramid"; }) => void; /** * Give an item to a target. * @param {ITEMS} item - The item to give. * @param {TargetNames} target - The target to give the item to. * @param {number} count - The number of items to give. */ give: ({ item, target, count }: { item: ITEMS; target: TargetNames; count?: number; }) => void; /** * Give loot to a target with a weighted chance for selecting one of the items. * @param {{ name: ITEMS, count: number, weight: number }[]} items - The items to give. * @param {TargetNames} target - The target to give the item to. */ giveLoot: ({ items, target }: { items: [{ name: ITEMS; count: number; weight: number; }]; target: TargetNames; }) => void; /** * Set a gamerule. * @param {GAMERULES} rule - The name of the gamerule. * @param {boolean | number} value - The value to set the gamerule to. */ gamerule: ({ rule, value }: { rule: GAMERULES; value: boolean | number; }) => void; /** * Kill entities matching a selector. * @param {SelectorArgument} selector - The entities to kill. */ kill: ({ selector }: { selector: TargetNames; }) => void; /** * Set an attribute for a target. * @param {ATTRIBUTES} attribute_ - The attribute to set. * @param {number} value - The value to set the attribute to. * @param {TargetNames} target - The target to set the attribute for. */ setAttribute: ({ attribute_, value, target }: { attribute_: ATTRIBUTES; value: number; target: TargetNames; }) => void; /** * Set the time of day. * @param {'day' | 'night'} time_ - The time to set. */ setTime: ({ time }: { time: "day" | "night"; }) => void; /** * Summon multiple entities at a specific location. */ summonMultiple: (params: { entity: ENTITY_TYPES; count: number; x: number; y: number; z: number; absolute: boolean; }) => void; /** * Set the end state of the challenge. * @param {string} end_state - The end state to set. */ setEndState: ({ endState }: { endState: string; }) => void; /** * Set a block at a specific location. */ setBlock: (params: { block: BLOCKS; x: number; y: number; z: number; absolute: boolean; }) => void; /** * Teleport entities to a specific location. * @param {TargetNames} target - The entities to teleport. * @param {number} x - The x coordinate of the destination. * @param {number} y - The y coordinate of the destination. * @param {number} z - The z coordinate of the destination. * @param {boolean} absolute - Whether the coordinates are absolute or relative. */ teleport: ({ target, x, y, z, absolute, }: { target: TargetNames; x: number; y: number; z: number; absolute: boolean; }) => void; /** * Send a chat message to a target. * @param {JSONTextComponent} message - The message to send. * @param {TargetNames} target - The target to send the message to. */ tellraw: ({ message, target }: { message: JSONTextComponent; target: TargetNames; }) => void; /** * Increment a score variable by 1. * @param variable - The score variable to increment. */ increment: ({ variable }: { variable: Score; }) => void; /** * Decrement a score variable by 1. * @param variable - The score variable to decrement. */ decrement: ({ variable }: { variable: Score; }) => void; /** * Set a score variable to a specific value. * @param variable - The score variable to set. * @param value - The value to set the score variable to, which can be a number or another score variable. */ set: ({ variable, value }: { variable: Score; value: number | Score; }) => void; /** * log a message with the watcher * @param {string} message - The message to send. * @param {Score} variable - The variable to log. * @param {boolean} store - Whether to store the variable in the backend. */ log_variable: ({ message, variable, store }: { message: string; variable: Score; store: boolean; }) => void; /** * Summon an item at a specific location. * @param {ITEMS} item - The item to summon. * @param {number} x - The x coordinate of the location. * @param {number} y - The y coordinate of the location. * @param {number} z - The z coordinate of the location. * @param {boolean} absolute - Whether the coordinates are absolute or relative. */ summonItem: ({ item, x, y, z, absolute }: { item: ITEMS; x: number; y: number; z: number; absolute: boolean; }) => void; /** * Count the number of a specific item in a target's inventory. * @param params - The parameters object. * @param params.target - The target to count items for. * @param params.item - The item to count. * @returns The variable containing the item count. */ countItems: ({ target, item }: { target: TargetNames; item: ITEMS; }) => Score; /** * Get the current player's position as x, y, z Score variables. * Must be called in a player context (e.g., inside forEveryPlayer or when @s is a player). * @returns An object with x, y, z Score variables containing the player's coordinates. */ getCurrentPlayerPosition: () => { x: Score; y: Score; z: Score; }; }; //# sourceMappingURL=actions.d.ts.map