@throw-out-error/minecraft-mcfunction
Version:
A simple way to create your mcfunction files using Typescript syntax.
57 lines (56 loc) • 2.85 kB
TypeScript
import { Range, Selector, Position, Rotation, Argument } from '../../arguments';
import { Command } from '../';
declare type Path = string;
declare type Type = 'byte' | 'short' | 'int' | 'long' | 'float' | 'double';
declare type Align = ['x' | 'y' | 'z' | 'xy' | 'xz' | 'yz' | 'xyz'];
declare type Anchored = ['eyes' | 'feet'];
declare type As = [Selector];
declare type At = [Selector];
declare type Facing = [Position] | ['entity', Selector, 'eyes' | 'feet'];
declare type In = ['overworld' | 'the_nether' | 'the_end' | string];
declare type Positioned = [Position] | ['positioned', 'as', Selector];
declare type Rotated = [Rotation] | ['rotated', 'as', Selector];
declare type Store_ReturnType = 'result' | 'success';
declare type Store_Block = [Store_ReturnType, 'block', Position, Path, Type, number];
declare type Store_Bossbar = [Store_ReturnType, 'bossbar', string, 'value' | 'max'];
declare type Store_Entity = [Store_ReturnType, 'entity', Selector, Type, number];
declare type Store_Score = [Store_ReturnType, 'score', string, string];
declare type Store_Storage = [Store_ReturnType, 'storage', string, Path, Type, number];
declare type Store = Store_Block | Store_Bossbar | Store_Entity | Store_Score | Store_Storage;
declare type If_Block = ['block', Position, string];
declare type If_Blocks = ['blocks', Position, Position, Position, 'all' | 'masked'];
declare type If_Data_Block = ['data', 'block', Position, Path];
declare type If_Data_Entity = ['entity', Selector, Path];
declare type If_Data_Storage = ['storage', string, Path];
declare type If_Data = If_Data_Block | If_Data_Entity | If_Data_Storage;
declare type If_Entity = ['entity', Selector];
declare type If_Predicate = ['predicate', string];
declare type If_Score_Compare = ['score', Selector, string, '<' | '<=' | '=' | '>=' | '>', Selector, string];
declare type If_Score_Range = ['score', Selector, string, 'matches', Range];
declare type If_Score = If_Score_Compare | If_Score_Range;
declare type If = If_Block | If_Blocks | If_Data | If_Entity | If_Predicate | If_Score;
declare type Unless = If;
export declare class ExecuteCommand extends Command<'execute'> {
run: Command;
conditions: Argument[];
constructor(run: Command);
get [Command.ARGUMENTS](): Argument[];
align(...args: Align): this;
anchored(...args: Anchored): this;
as(...args: As): this;
at(...args: At): this;
facing(...args: Facing): this;
in(...args: In): this;
positioned(...args: Positioned): this;
rotated(...args: Rotated): this;
store(...args: Store): this;
if(...args: If): this;
unless(...args: Unless): this;
}
export declare function execute(run: Command): ExecuteCommand;
declare module '../' {
interface CommandContext {
execute: typeof execute;
}
}
export {};