refactor(plugin-api): Add pumpkin-plugin-wit as subtree

This commit is contained in:
Demetrius Kanios committed 2026-09-14 11:02:09 -07:00
commit f40c08ca26
49 files changed
+14389

No files matched your search

@@ -0,0 +1,41 @@
package pumpkin:plugin@0.1.0;
interface advancement {
use text.{text-component};
/// Frame type for an advancement.
enum frame-type {
task,
challenge,
goal,
}
/// Display information for an advancement.
record advancement-display {
title: text-component,
description: text-component,
frame: frame-type,
show-toast: bool,
hidden: bool,
announce-to-chat: bool,
background: option<string>,
x: f32,
y: f32,
}
/// Detailed information about an advancement.
record advancement-info {
id: string,
parent-id: option<string>,
criteria: list<string>,
display: option<advancement-display>,
}
/// Represents progress of an advancement for a player.
record advancement-progress {
advancement-id: string,
done: bool,
awarded-criteria: list<string>,
remaining-criteria: list<string>,
}
}
@@ -0,0 +1,56 @@
package pumpkin:plugin@0.1.0;
interface attributes {
enum attribute {
air-drag-modifier,
armor,
armor-toughness,
attack-damage,
attack-knockback,
attack-speed,
below-name-distance,
block-break-speed,
block-interaction-range,
bounciness,
burning-time,
camera-distance,
explosion-knockback-resistance,
entity-interaction-range,
fall-damage-multiplier,
flying-speed,
follow-range,
friction-modifier,
gravity,
jump-strength,
knockback-resistance,
luck,
max-absorption,
max-health,
mining-efficiency,
movement-efficiency,
movement-speed,
name-tag-distance,
oxygen-bonus,
safe-fall-distance,
scale,
sneaking-speed,
spawn-reinforcements,
step-height,
submerged-mining-speed,
sweeping-damage-ratio,
tempt-range,
water-movement-efficiency,
waypoint-transmit-range,
waypoint-receive-range,
}
enum modifier-operation {
add,
multiply-base,
multiply-total,
}
record attribute-modifier {
id: string,
amount: f64,
operation: modifier-operation,
}
}
File diff suppressed because it is too large. Load diff
+72
View File
@@ -0,0 +1,72 @@
package pumpkin:plugin@0.1.0;
interface biomes {
enum biome {
badlands,
bamboo-jungle,
basalt-deltas,
beach,
birch-forest,
cherry-grove,
cold-ocean,
crimson-forest,
dark-forest,
deep-cold-ocean,
deep-dark,
deep-frozen-ocean,
deep-lukewarm-ocean,
deep-ocean,
desert,
dripstone-caves,
end-barrens,
end-highlands,
end-midlands,
eroded-badlands,
flower-forest,
forest,
frozen-ocean,
frozen-peaks,
frozen-river,
grove,
ice-spikes,
jagged-peaks,
jungle,
lukewarm-ocean,
lush-caves,
mangrove-swamp,
meadow,
mushroom-fields,
nether-wastes,
ocean,
old-growth-birch-forest,
old-growth-pine-taiga,
old-growth-spruce-taiga,
pale-garden,
plains,
river,
savanna,
savanna-plateau,
small-end-islands,
snowy-beach,
snowy-plains,
snowy-slopes,
snowy-taiga,
soul-sand-valley,
sparse-jungle,
stony-peaks,
stony-shore,
sulfur-caves,
sunflower-plains,
swamp,
taiga,
the-end,
the-void,
warm-ocean,
warped-forest,
windswept-forest,
windswept-gravelly-hills,
windswept-hills,
windswept-savanna,
wooded-badlands,
}
}
@@ -0,0 +1,423 @@
interface block-entity {
use common.{block-pos, nbt-tree};
use item-stack.{item-stack};
use inventory.{inventory};
resource block-entity {
resource-location: func() -> string;
get-position: func() -> block-pos;
get-id: func() -> u32;
is-dirty: func() -> bool;
clear-dirty: func();
/// Sets a namespaced custom data value on this block entity.
set-custom-data: func(namespace: string, key: string, value: nbt-tree);
/// Returns a namespaced custom data value from this block entity, if set.
get-custom-data: func(namespace: string, key: string) -> option<nbt-tree>;
/// Removes a namespaced custom data value from this block entity.
remove-custom-data: func(namespace: string, key: string);
/// Returns whether this block entity has a namespaced custom data value.
has-custom-data: func(namespace: string, key: string) -> bool;
}
resource container-block-entity {
get-block-entity: func() -> block-entity;
/// Returns the generic inventory handle for this container.
get-inventory: func() -> inventory;
get-size: func() -> u32;
is-empty: func() -> bool;
get-stack: func(slot: u32) -> option<item-stack>;
set-stack: func(slot: u32, stack: option<item-stack>);
remove-stack: func(slot: u32) -> option<item-stack>;
clear: func();
}
resource command-block-entity {
get-block-entity: func () -> block-entity;
last-output: func() -> string;
track-output: func() -> bool;
success-count: func() -> u32;
command: func() -> string;
auto: func() -> bool;
condition-met: func() -> bool;
powered: func() -> bool;
}
enum dye-color {
white,
orange,
magenta,
light-blue,
yellow,
lime,
pink,
gray,
light-gray,
cyan,
purple,
blue,
brown,
green,
red,
black,
}
record sign-text {
messages: list<string>,
color: dye-color,
has-glowing-text: bool,
}
resource sign-block-entity {
get-block-entity: func() -> block-entity;
get-front-text: func() -> sign-text;
set-front-text: func(text: sign-text);
get-back-text: func() -> sign-text;
set-back-text: func(text: sign-text);
is-waxed: func() -> bool;
set-waxed: func(waxed: bool);
}
resource jukebox-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
is-playing: func() -> bool;
stop-playing: func();
start-playing: func(length-in-ticks: u64);
}
resource chest-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
viewer-count: func() -> u32;
}
resource mob-spawner-block-entity {
get-block-entity: func() -> block-entity;
get-spawn-count: func() -> s32;
get-spawn-range: func() -> s32;
get-delay: func() -> s32;
}
resource map-block-entity {
get-block-entity: func() -> block-entity;
get-map-id: func() -> s32;
set-map-id: func(map-id: s32);
get-colors: func() -> list<u8>;
set-colors: func(colors: list<u8>);
set-pixel: func(x: u32, y: u32, color: u8);
get-pixel: func(x: u32, y: u32) -> u8;
update: func();
stream-frame: func(frame-data: list<u8>);
}
resource hanging-sign-block-entity {
get-block-entity: func() -> block-entity;
get-front-text: func() -> sign-text;
set-front-text: func(text: sign-text);
get-back-text: func() -> sign-text;
set-back-text: func(text: sign-text);
is-waxed: func() -> bool;
set-waxed: func(waxed: bool);
}
resource trapped-chest-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
viewer-count: func() -> u32;
}
resource banner-block-entity {
get-block-entity: func() -> block-entity;
get-custom-name: func() -> option<string>;
}
resource barrel-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
viewer-count: func() -> u32;
}
resource beacon-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
get-primary-effect: func() -> s32;
get-secondary-effect: func() -> s32;
get-levels: func() -> s32;
}
resource bed-block-entity {
get-block-entity: func() -> block-entity;
}
resource beehive-block-entity {
get-block-entity: func() -> block-entity;
get-bee-count: func() -> u32;
}
resource bell-block-entity {
get-block-entity: func() -> block-entity;
is-ringing: func() -> bool;
get-ring-ticks: func() -> s32;
}
resource blasting-furnace-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
get-cooking-time-spent: func() -> u16;
get-cooking-total-time: func() -> u16;
get-lit-time-remaining: func() -> u16;
get-lit-total-time: func() -> u16;
is-burning: func() -> bool;
}
resource brewing-stand-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
get-brew-time: func() -> s32;
get-fuel: func() -> s32;
}
resource brushable-block-block-entity {
get-block-entity: func() -> block-entity;
}
resource calibrated-sculk-sensor-block-entity {
get-block-entity: func() -> block-entity;
}
resource campfire-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
}
resource chiseled-bookshelf-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
get-last-interacted-slot: func() -> s8;
}
resource comparator-block-entity {
get-block-entity: func() -> block-entity;
get-output-signal: func() -> u8;
}
resource conduit-block-entity {
get-block-entity: func() -> block-entity;
}
resource copper-golem-statue-block-entity {
get-block-entity: func() -> block-entity;
}
resource crafter-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
get-crafting-ticks-remaining: func() -> s32;
is-triggered: func() -> bool;
}
resource creaking-heart-block-entity {
get-block-entity: func() -> block-entity;
get-creaking-uuid: func() -> option<string>;
}
resource daylight-detector-block-entity {
get-block-entity: func() -> block-entity;
}
resource decorated-pot-block-entity {
get-block-entity: func() -> block-entity;
}
resource dispenser-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
}
resource dropper-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
}
resource enchanting-table-block-entity {
get-block-entity: func() -> block-entity;
}
resource end-gateway-block-entity {
get-block-entity: func() -> block-entity;
get-age: func() -> s64;
is-exact-teleport: func() -> bool;
}
resource end-portal-block-entity {
get-block-entity: func() -> block-entity;
}
resource ender-chest-block-entity {
get-block-entity: func() -> block-entity;
viewer-count: func() -> u32;
}
resource furnace-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
get-cooking-time-spent: func() -> u16;
get-cooking-total-time: func() -> u16;
get-lit-time-remaining: func() -> u16;
get-lit-total-time: func() -> u16;
is-burning: func() -> bool;
}
resource hopper-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
get-cooldown: func() -> s32;
}
resource jigsaw-block-entity {
get-block-entity: func() -> block-entity;
get-name: func() -> string;
get-target: func() -> string;
get-pool: func() -> string;
get-final-state: func() -> string;
get-selection-priority: func() -> s32;
get-placement-priority: func() -> s32;
}
resource lectern-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
get-page: func() -> u32;
}
resource piston-block-entity {
get-block-entity: func() -> block-entity;
get-progress: func() -> f32;
is-extending: func() -> bool;
is-source: func() -> bool;
}
resource potent-sulfur-block-entity {
get-block-entity: func() -> block-entity;
}
resource sculk-catalyst-block-entity {
get-block-entity: func() -> block-entity;
}
resource sculk-sensor-block-entity {
get-block-entity: func() -> block-entity;
}
resource sculk-shrieker-block-entity {
get-block-entity: func() -> block-entity;
get-warning-level: func() -> s32;
}
resource shelf-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
}
resource shulker-box-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
viewer-count: func() -> u32;
}
resource skull-block-entity {
get-block-entity: func() -> block-entity;
get-note-block-sound: func() -> option<string>;
}
resource smoker-block-entity {
get-block-entity: func() -> block-entity;
get-container: func() -> container-block-entity;
get-cooking-time-spent: func() -> u16;
get-cooking-total-time: func() -> u16;
get-lit-time-remaining: func() -> u16;
get-lit-total-time: func() -> u16;
is-burning: func() -> bool;
}
resource structure-block-block-entity {
get-block-entity: func() -> block-entity;
get-name: func() -> string;
get-author: func() -> string;
get-mode: func() -> string;
get-integrity: func() -> f32;
get-seed: func() -> s64;
}
resource test-block-block-entity {
get-block-entity: func() -> block-entity;
}
resource test-instance-block-block-entity {
get-block-entity: func() -> block-entity;
}
resource trial-spawner-block-entity {
get-block-entity: func() -> block-entity;
}
resource vault-block-entity {
get-block-entity: func() -> block-entity;
}
variant block-entity-type {
command-block-entity(command-block-entity),
sign-block-entity(sign-block-entity),
hanging-sign-block-entity(hanging-sign-block-entity),
jukebox-block-entity(jukebox-block-entity),
chest-block-entity(chest-block-entity),
trapped-chest-block-entity(trapped-chest-block-entity),
mob-spawner-block-entity(mob-spawner-block-entity),
map-block-entity(map-block-entity),
banner-block-entity(banner-block-entity),
barrel-block-entity(barrel-block-entity),
beacon-block-entity(beacon-block-entity),
bed-block-entity(bed-block-entity),
beehive-block-entity(beehive-block-entity),
bell-block-entity(bell-block-entity),
blasting-furnace-block-entity(blasting-furnace-block-entity),
brewing-stand-block-entity(brewing-stand-block-entity),
brushable-block-block-entity(brushable-block-block-entity),
calibrated-sculk-sensor-block-entity(calibrated-sculk-sensor-block-entity),
campfire-block-entity(campfire-block-entity),
chiseled-bookshelf-block-entity(chiseled-bookshelf-block-entity),
comparator-block-entity(comparator-block-entity),
conduit-block-entity(conduit-block-entity),
copper-golem-statue-block-entity(copper-golem-statue-block-entity),
crafter-block-entity(crafter-block-entity),
creaking-heart-block-entity(creaking-heart-block-entity),
daylight-detector-block-entity(daylight-detector-block-entity),
decorated-pot-block-entity(decorated-pot-block-entity),
dispenser-block-entity(dispenser-block-entity),
dropper-block-entity(dropper-block-entity),
enchanting-table-block-entity(enchanting-table-block-entity),
end-gateway-block-entity(end-gateway-block-entity),
end-portal-block-entity(end-portal-block-entity),
ender-chest-block-entity(ender-chest-block-entity),
furnace-block-entity(furnace-block-entity),
hopper-block-entity(hopper-block-entity),
jigsaw-block-entity(jigsaw-block-entity),
lectern-block-entity(lectern-block-entity),
piston-block-entity(piston-block-entity),
potent-sulfur-block-entity(potent-sulfur-block-entity),
sculk-catalyst-block-entity(sculk-catalyst-block-entity),
sculk-sensor-block-entity(sculk-sensor-block-entity),
sculk-shrieker-block-entity(sculk-shrieker-block-entity),
shelf-block-entity(shelf-block-entity),
shulker-box-block-entity(shulker-box-block-entity),
skull-block-entity(skull-block-entity),
smoker-block-entity(smoker-block-entity),
structure-block-block-entity(structure-block-block-entity),
test-block-block-entity(test-block-block-entity),
test-instance-block-block-entity(test-instance-block-block-entity),
trial-spawner-block-entity(trial-spawner-block-entity),
vault-block-entity(vault-block-entity),
container-block-entity(container-block-entity),
}
}
@@ -0,0 +1,83 @@
interface boss-bar {
use text.{text-component};
use player.{player};
/// Represents the color of a boss bar.
enum boss-bar-color {
pink,
blue,
red,
green,
yellow,
purple,
white,
}
/// Represents the notches/divisions of a boss bar.
enum boss-bar-division {
no-division,
notches-6,
notches-10,
notches-12,
notches-20,
}
/// Metadata flags that can be toggled on a boss bar.
record boss-bar-metadata {
/// Darkens the sky for players who see the boss bar.
darken-sky: bool,
/// If true, the bar is considered a "dragon bar" (used for Ender Dragon).
dragon-bar: bool,
/// If true, fog is created around the players who see the boss bar.
create-fog: bool,
}
/// Represents a boss bar that can be shown to players.
resource boss-bar {
/// Creates a new boss bar.
constructor(title: text-component, color: boss-bar-color, division: boss-bar-division);
/// Returns the title of this boss bar.
get-title: func() -> text-component;
/// Sets the title of this boss bar.
set-title: func(title: text-component);
/// Returns the health (0.0 to 1.0) of this boss bar.
get-health: func() -> f32;
/// Sets the health (0.0 to 1.0) of this boss bar.
set-health: func(health: f32);
/// Returns the color of this boss bar.
get-color: func() -> boss-bar-color;
/// Sets the color of this boss bar.
set-color: func(color: boss-bar-color);
/// Returns the division of this boss bar.
get-division: func() -> boss-bar-division;
/// Sets the division of this boss bar.
set-division: func(division: boss-bar-division);
/// Returns the currently active metadata on this boss bar.
get-metadata: func() -> boss-bar-metadata;
/// Updates the metadata on this boss bar.
set-metadata: func(metadata: boss-bar-metadata);
/// Adds a player to this boss bar, making it visible to them.
add-player: func(player: player);
/// Removes a player from this boss bar, hiding it from them.
remove-player: func(player: player);
/// Returns a list of all players currently seeing this boss bar.
get-players: func() -> list<player>;
/// Removes this boss bar from all players and cleans it up.
remove-all: func();
}
}
+244
View File
@@ -0,0 +1,244 @@
interface command {
use %world.{%world, entity};
use player.{player};
use block-entity.{command-block-entity};
use common.{position, block-pos, locale, game-mode};
use item-stack.{item-stack};
use server.{server, difficulty};
use text.{text-component};
variant command-error {
invalid-consumption(option<string>),
invalid-requirement,
permission-denied,
command-failed(text-component),
}
resource command-node {
literal: static func(name: string) -> command-node;
argument: static func(name: string, %type: argument-type) -> command-node;
then: func(node: command-node);
execute-with-handler-id: func(handler-id: u32);
suggest-with-handler-id: func(handler-id: u32);
require-with-handler-id: func(handler-id: u32);
}
record suggestion-request {
input: string,
cursor: u32,
start: u32,
remaining: string,
}
record command-suggestion {
value: string,
tooltip: option<text-component>,
}
record command-suggestions {
start: u32,
length: u32,
values: list<command-suggestion>,
}
variant argument-type {
%bool,
float(tuple<option<f32>, option<f32>>),
double(tuple<option<f64>, option<f64>>),
integer(tuple<option<s32>, option<s32>>),
long(tuple<option<s64>, option<s64>>),
%string(string-type),
entities,
entity,
players,
game-profile,
block-pos,
column-pos,
position3d,
position2d,
block-state,
block-predicate,
item,
item-predicate,
color,
component,
style,
message,
nbt-compound-tag,
nbt-tag,
nbt-path,
objective,
objective-criteria,
operation,
particle,
angle,
rotation,
scoreboard-slot,
score-holder(bool),
swizzle,
team,
item-slot,
resource-location,
mob-effect,
function,
entity-anchor,
int-range,
float-range,
dimension,
gamemode,
difficulty,
time(option<s32>),
%resource(string),
resource-or-tag(string),
resource-or-tag-key(string),
resource-key(string),
template-mirror,
template-rotation,
uuid,
}
record entity-argument {
single: bool,
players-only: bool,
}
variant command-sender-type {
rcon,
console,
player(player),
command-block(tuple<command-block-entity, %world>),
dummy,
}
enum permission-level {
zero,
one,
two,
three,
four,
}
resource command-sender {
get-command-sender-type: func() -> command-sender-type;
get-name: func() -> string;
send-message: func(text: text-component);
send-system-message: func(text: text-component);
send-error: func(text: text-component);
set-success-count: func(count: s32);
is-player: func() -> bool;
is-console: func() -> bool;
as-player: func() -> option<player>;
permission-level: func() -> permission-level;
has-permission-level: func(level: permission-level) -> bool;
has-permission: func(server: borrow<server>, node: string) -> bool;
position: func() -> option<position>;
%world: func() -> option<%world>;
get-locale: func() -> locale;
should-receive-feedback: func() -> bool;
should-broadcast-console-to-ops: func() -> bool;
should-track-output: func() -> bool;
}
enum string-type {
single-word,
quotable,
greedy,
}
enum suggestion-type {
ask-server,
all-recipes,
available-sounds,
available-biomes,
summonable-entities,
}
variant arg {
simple(string),
msg(string),
%bool(bool),
item(string),
item-predicate(string),
resource-location(string),
block(string),
block-predicate(string),
time(s32),
num(result<number, not-in-bounds>),
block-pos(block-pos),
pos3d(tuple<f64, f64, f64>),
pos2d(tuple<f64, f64>),
rotation(tuple<f32, bool, f32, bool>),
gamemode(game-mode),
difficulty(difficulty),
players(list<player>),
particle(string),
text-component(text-component),
bossbar-color(bossbar-color),
bossbar-style(bossbar-style),
sound-category(sound-category),
damage-type(string),
effect(string),
enchantment(string),
advancement(string),
entity-anchor(entity-anchor),
}
enum bossbar-color {
pink,
blue,
red,
green,
yellow,
purple,
white,
}
enum bossbar-style {
no-division,
notches6,
notches10,
notches12,
notches20,
}
enum sound-category {
master,
music,
records,
weather,
blocks,
hostile,
neutral,
players,
ambient,
voice,
}
enum entity-anchor {
eyes,
feet,
}
variant number {
float64(f64),
float32(f32),
int32(s32),
int64(s64),
}
variant not-in-bounds {
lower-bound(tuple<number, number>),
upper-bound(tuple<number, number>),
}
resource consumed-args {
get-value: func(key: string) -> arg;
}
resource command {
/// First name is primary, rest are aliases
constructor(names: list<string>, description: string);
then: func(node: command-node);
execute-with-handler-id: func(handler-id: u32);
}
}
+261
View File
@@ -0,0 +1,261 @@
/// Provides common types and utilities used across the entire plugin API.
interface common {
/// Serialized text component as a postcard byte array.
/// @deprecated Use the text-component resource from the text interface instead.
type raw-text-component = list<u8>;
/// Represents one entry in an NBT compound tag.
record nbt-entry {
key: string,
value: u32,
}
/// Represents a Minecraft NBT tag tree.
record nbt-tree {
root: u32,
tags: list<nbt-tag>,
}
/// Represents a Minecraft NBT tag.
variant nbt-tag {
byte(s8),
short(s16),
int(s32),
long(s64),
float(f32),
double(f64),
byte-array(list<s8>),
string-tag(string),
list-tag(list<u32>),
compound(list<nbt-entry>),
int-array(list<s32>),
long-array(list<s64>),
}
/// A position in the world grid (integers).
record block-pos {
x: s32,
y: s32,
z: s32,
}
/// A precise coordinate in the world (floats).
type position = tuple<f64, f64, f64>;
/// Represents the hands of a player.
enum hand {
left,
right,
}
/// Represents the game modes available in Minecraft.
enum game-mode {
survival,
creative,
adventure,
spectator,
}
/// The 16 base Minecraft colors.
enum named-color {
black,
dark-blue,
dark-green,
dark-aqua,
dark-red,
dark-purple,
gold,
gray,
dark-gray,
blue,
green,
aqua,
red,
light-purple,
yellow,
white,
}
/// An RGB color represented by its red, green, and blue components.
record rgb-color {
r: u8,
g: u8,
b: u8,
}
/// An ARGB color with alpha (transparency) channel.
record argb-color {
a: u8,
r: u8,
g: u8,
b: u8,
}
/// Represents the type of click interaction in a GUI.
enum click-type {
left,
right,
shift-left,
shift-right,
middle,
drop,
control-drop,
double-click,
number-key,
unknown,
}
/// Represents the various poses an entity can be in.
enum entity-pose {
standing,
fall-flying,
sleeping,
swimming,
spin-attack,
crouching,
long-jumping,
dying,
croaking,
using-tongue,
sitting,
roaring,
sniffing,
emerging,
digging,
sliding,
shooting,
inhaling,
}
/// All Minecraft-supported locales.
enum locale {
af-za,
ar-sa,
ast-es,
az-az,
ba-ru,
bar,
be-by,
bg-bg,
br-fr,
brb,
bs-ba,
ca-es,
cs-cz,
cy-gb,
da-dk,
de-at,
de-ch,
de-de,
el-gr,
en-au,
en-ca,
en-gb,
en-nz,
en-pt,
en-ud,
en-us,
enp,
enws,
eo-uy,
es-ar,
es-cl,
es-ec,
es-es,
es-mx,
es-uy,
es-ve,
esan,
et-ee,
eu-es,
fa-ir,
fi-fi,
fil-ph,
fo-fo,
fr-ca,
fr-fr,
fra-de,
fur-it,
fy-nl,
ga-ie,
gd-gb,
gl-es,
haw-us,
he-il,
hi-in,
hr-hr,
hu-hu,
hy-am,
id-id,
ig-ng,
io-en,
is-is,
isv,
it-it,
ja-jp,
jbo-en,
ka-ge,
kk-kz,
kn-in,
ko-kr,
ksh,
kw-gb,
la-la,
lb-lu,
li-li,
lmo,
lo-la,
lol-us,
lt-lt,
lv-lv,
lzh,
mk-mk,
mn-mn,
ms-my,
mt-mt,
nah,
nds-de,
nl-be,
nl-nl,
nn-no,
no-no,
oc-fr,
ovd,
pl-pl,
pt-br,
pt-pt,
qya-aa,
ro-ro,
rpr,
ru-ru,
ry-ua,
sah-sah,
se-no,
sk-sk,
sl-si,
so-so,
sq-al,
sr-cs,
sr-sp,
sv-se,
sxu,
szl,
ta-in,
th-th,
tl-ph,
tlh-aa,
tok,
tr-tr,
tt-ru,
uk-ua,
val-es,
vec-it,
vi-vn,
yi-de,
yo-ng,
zh-cn,
zh-hk,
zh-tw,
zlm-arab,
}
}
@@ -0,0 +1,61 @@
/// The core context provided to a plugin during initialization and event handling.
interface context {
use server.{server};
use event.{event-type, event-priority};
use command.{command};
use permission.{permission};
/// Verified marketplace metadata for signed plugins.
record marketplace-metadata {
/// The marketplace base URL where this plugin is registered.
marketplace-url: string,
/// The unique plugin ID on the marketplace.
plugin-id: s64,
/// The canonical plugin name.
plugin-name: string,
/// The semver version string of the plugin.
version: string,
/// Developer ID.
dev-id: s64,
/// Developer display name or username.
dev-name: string,
/// Whether this is a paid marketplace plugin.
is-paid: bool,
/// The buyer / licensee user ID (0 for free/open-source).
user-id: s64,
/// Unique license key issued to the buyer, if paid.
license-key: option<string>,
/// ISO-8601 timestamp of when this binary/license was issued.
issued-at: string,
}
/// A contextual handle for plugin-related operations.
resource context {
/// Registers a handler for a specific event.
///
/// * `handler-id`: Unique ID for the event handler.
/// * `event-type`: The type of event to listen for.
/// * `event-priority`: When this handler should be called relative to others.
/// * `blocking`: Whether the event should wait for this handler to finish.
register-event: func(handler-id: u32, event-type: event-type, event-priority: event-priority, blocking: bool);
/// Registers a new command.
///
/// * `command`: The command definition.
/// * `permission`: The required permission node to execute this command.
register-command: func(command: command, permission: string);
/// Registers a permission node with the server.
register-permission: func(permission: permission) -> result<_, string>;
/// Returns the path to the plugin's private data folder.
get-data-folder: func() -> string;
/// Returns the global server instance.
get-server: func() -> server;
/// Returns verified marketplace metadata if this plugin binary is signed, or none if unsigned.
get-marketplace-metadata: func() -> option<marketplace-metadata>;
}
}
@@ -0,0 +1,57 @@
package pumpkin:plugin@0.1.0;
interface damage-types {
enum damage-type {
arrow,
bad-respawn-point,
cactus,
campfire,
cramming,
dragon-breath,
drown,
dry-out,
ender-pearl,
explosion,
fall,
falling-anvil,
falling-block,
falling-stalactite,
fireball,
fireworks,
fly-into-wall,
freeze,
generic,
generic-kill,
hot-floor,
in-fire,
in-wall,
indirect-magic,
lava,
lightning-bolt,
mace-smash,
magic,
mob-attack,
mob-attack-no-aggro,
mob-projectile,
on-fire,
out-of-world,
outside-border,
player-attack,
player-explosion,
sonic-boom,
spear,
spit,
stalagmite,
starve,
sting,
sulfur-cube-hot,
sweet-berry-bush,
thorns,
thrown,
trident,
unattributed-fireball,
wind-charge,
wither,
wither-skull,
}
}
@@ -0,0 +1,117 @@
package pumpkin:plugin@0.1.0;
interface data-components {
enum data-component {
custom-data,
max-stack-size,
max-damage,
damage,
unbreakable,
use-effects,
custom-name,
minimum-attack-charge,
damage-type,
item-name,
item-model,
lore,
rarity,
enchantments,
can-place-on,
can-break,
attribute-modifiers,
custom-model-data,
tooltip-display,
repair-cost,
creative-slot-lock,
enchantment-glint-override,
intangible-projectile,
food,
consumable,
use-remainder,
use-cooldown,
damage-resistant,
tool,
weapon,
attack-range,
enchantable,
equippable,
repairable,
glider,
tooltip-style,
death-protection,
blocks-attacks,
piercing-weapon,
kinetic-weapon,
swing-animation,
additional-trade-cost,
stored-enchantments,
dye,
dyed-color,
map-color,
map-id,
map-decorations,
map-post-processing,
charged-projectiles,
bundle-contents,
potion-contents,
potion-duration-scale,
suspicious-stew-effects,
writable-book-content,
written-book-content,
trim,
debug-stick-state,
entity-data,
bucket-entity-data,
block-entity-data,
instrument,
provides-trim-material,
ominous-bottle-amplifier,
jukebox-playable,
provides-banner-patterns,
recipes,
lodestone-tracker,
firework-explosion,
fireworks,
profile,
note-block-sound,
banner-patterns,
base-color,
pot-decorations,
container,
block-state,
bees,
sulfur-cube-content,
lock,
container-loot,
break-sound,
villager-variant,
wolf-variant,
wolf-sound-variant,
wolf-collar,
fox-variant,
salmon-size,
parrot-variant,
tropical-fish-pattern,
tropical-fish-base-color,
tropical-fish-pattern-color,
mooshroom-variant,
rabbit-variant,
pig-variant,
pig-sound-variant,
cow-variant,
cow-sound-variant,
chicken-variant,
chicken-sound-variant,
zombie-nautilus-variant,
frog-variant,
horse-variant,
painting-variant,
llama-variant,
axolotl-variant,
cat-variant,
cat-sound-variant,
cat-collar,
sheep-color,
shulker-color,
}
}
@@ -0,0 +1,54 @@
package pumpkin:plugin@0.1.0;
interface datapack {
/// Information about a discovered or loaded datapack.
record datapack-info {
id: string,
name: string,
description: string,
pack-format: u32,
is-enabled: bool,
recipe-count: u32,
function-count: u32,
}
/// Position options for enabling a datapack relative to other packs.
variant enable-position {
first,
last,
before(string),
after(string),
}
/// Global manager for inspecting and controlling server datapacks.
resource datapack-manager {
/// Returns all known datapacks (both enabled and available/disabled).
list-all-packs: func() -> list<datapack-info>;
/// Returns only currently enabled datapacks.
list-enabled-packs: func() -> list<datapack-info>;
/// Returns available (disabled) datapacks.
list-available-packs: func() -> list<datapack-info>;
/// Retrieves details about a specific datapack by name or ID.
get-pack: func(name: string) -> option<datapack-info>;
/// Checks if a datapack is currently enabled.
is-enabled: func(name: string) -> bool;
/// Enables a datapack with a specific priority position.
enable-pack: func(name: string, position: enable-position) -> result<_, string>;
/// Disables an enabled datapack.
disable-pack: func(name: string) -> result<_, string>;
/// Reloads all enabled datapacks, recipes, and function tags,
/// synchronizes recipes with online players, and triggers `#minecraft:load`.
reload: func() -> result<_, string>;
/// Executes a datapack function or function tag (e.g. "namespace:fn" or "#namespace:tag").
/// Returns the number of commands executed.
execute-function: func(name: string) -> result<u32, string>;
}
}
+171
View File
@@ -0,0 +1,171 @@
interface display {
use %world.{entity};
use text.{text-component};
use item-stack.{item-stack};
use uuid.{uuid};
/// Billboard rendering constraints for display entities.
enum billboard-mode {
fixed,
vertical,
horizontal,
center,
}
/// Item display transformation modes for item display entities.
enum item-display-mode {
none,
thirdperson-lefthand,
thirdperson-righthand,
firstperson-lefthand,
firstperson-righthand,
head,
gui,
ground,
fixed,
}
/// Text alignment options for text display entities.
enum text-alignment {
center,
left,
right,
}
/// 3D single-precision vector.
record vector3f {
x: f32,
y: f32,
z: f32,
}
/// Single-precision quaternion representing a 3D rotation.
record quaternionf {
x: f32,
y: f32,
z: f32,
w: f32,
}
/// Transformation (translation, scale, left and right rotations) for display entities.
record display-transformation {
translation: vector3f,
scale: vector3f,
left-rotation: quaternionf,
right-rotation: quaternionf,
}
/// Common base resource for all display entities.
resource display-entity {
from-entity: static func(entity: borrow<entity>) -> option<display-entity>;
get-entity: func() -> entity;
get-transformation: func() -> display-transformation;
set-transformation: func(transformation: display-transformation);
get-interpolation-duration: func() -> s32;
set-interpolation-duration: func(duration: s32);
get-interpolation-start: func() -> s32;
set-interpolation-start: func(delta-ticks: s32);
get-teleport-duration: func() -> s32;
set-teleport-duration: func(duration: s32);
get-billboard: func() -> billboard-mode;
set-billboard: func(mode: billboard-mode);
get-view-range: func() -> f32;
set-view-range: func(range: f32);
get-shadow-radius: func() -> f32;
set-shadow-radius: func(radius: f32);
get-shadow-strength: func() -> f32;
set-shadow-strength: func(strength: f32);
get-display-width: func() -> f32;
set-display-width: func(width: f32);
get-display-height: func() -> f32;
set-display-height: func(height: f32);
get-glow-color-override: func() -> s32;
set-glow-color-override: func(color: s32);
get-brightness: func() -> s32;
set-brightness: func(brightness: s32);
}
/// Resource specifically for Block Display entities.
resource block-display-entity {
from-entity: static func(entity: borrow<entity>) -> option<block-display-entity>;
get-display: func() -> display-entity;
get-entity: func() -> entity;
get-block-state-id: func() -> u16;
set-block-state-id: func(state-id: u16);
}
/// Resource specifically for Item Display entities.
resource item-display-entity {
from-entity: static func(entity: borrow<entity>) -> option<item-display-entity>;
get-display: func() -> display-entity;
get-entity: func() -> entity;
get-item: func() -> option<item-stack>;
set-item: func(item: option<item-stack>);
get-item-display-mode: func() -> item-display-mode;
set-item-display-mode: func(mode: item-display-mode);
}
/// Resource specifically for Text Display entities.
resource text-display-entity {
from-entity: static func(entity: borrow<entity>) -> option<text-display-entity>;
get-display: func() -> display-entity;
get-entity: func() -> entity;
get-text: func() -> text-component;
set-text: func(text: text-component);
get-line-width: func() -> s32;
set-line-width: func(width: s32);
get-background: func() -> s32;
set-background: func(color: s32);
get-text-opacity: func() -> s8;
set-text-opacity: func(opacity: s8);
get-shadow: func() -> bool;
set-shadow: func(shadow: bool);
get-see-through: func() -> bool;
set-see-through: func(see-through: bool);
get-default-background: func() -> bool;
set-default-background: func(default-background: bool);
get-alignment: func() -> text-alignment;
set-alignment: func(alignment: text-alignment);
}
/// Resource specifically for Interaction entities.
resource interaction-entity {
from-entity: static func(entity: borrow<entity>) -> option<interaction-entity>;
get-entity: func() -> entity;
get-width: func() -> f32;
set-width: func(width: f32);
get-height: func() -> f32;
set-height: func(height: f32);
get-response: func() -> bool;
set-response: func(response: bool);
get-last-attacker: func() -> option<uuid>;
get-last-interaction: func() -> option<uuid>;
}
}
@@ -0,0 +1,102 @@
package pumpkin:plugin@0.1.0;
interface enchantments {
use text.{text-component};
/// Equipment slot where an enchantment is active.
enum attribute-modifier-slot {
any,
main-hand,
off-hand,
hand,
feet,
legs,
chest,
head,
armor,
body,
saddle,
}
/// Vanilla enchantments enum.
enum enchantment {
aqua-affinity,
bane-of-arthropods,
binding-curse,
blast-protection,
breach,
channeling,
density,
depth-strider,
efficiency,
feather-falling,
fire-aspect,
fire-protection,
flame,
fortune,
frost-walker,
impaling,
infinity,
knockback,
looting,
loyalty,
luck-of-the-sea,
lunge,
lure,
mending,
multishot,
piercing,
power,
projectile-protection,
protection,
punch,
quick-charge,
respiration,
riptide,
sharpness,
silk-touch,
smite,
soul-speed,
sweeping-edge,
swift-sneak,
thorns,
unbreaking,
vanishing-curse,
wind-burst,
}
/// Represents a custom enchantment definition.
record custom-enchantment {
/// Unique identifier for the enchantment (e.g. "my_plugin:lifesteal").
id: string,
/// Description or display name of the enchantment.
description: text-component,
/// Maximum level of the enchantment (e.g. 1..=10).
max-level: u32,
/// Base anvil repair/combination cost multiplier.
anvil-cost: u32,
/// Tag or item pattern for supported items (e.g. "#minecraft:enchantable/weapon").
supported-items: string,
/// Weight / rarity of the enchantment (higher = more common, default 5).
weight: u32,
/// Equipment slots where this enchantment is active.
slots: list<attribute-modifier-slot>,
/// List of exclusive/conflicting enchantment IDs.
exclusive-set: list<string>,
}
/// Global manager for registering and querying custom enchantments.
resource enchantment-manager {
/// Registers a new custom enchantment with the server.
register-enchantment: func(enchantment: custom-enchantment) -> result<_, string>;
/// Gets an enchantment definition by its ID.
get-enchantment: func(id: string) -> option<custom-enchantment>;
/// Checks if an enchantment ID is registered.
has-enchantment: func(id: string) -> bool;
/// Returns all registered custom enchantment IDs.
get-all-enchantment-ids: func() -> list<string>;
}
}
@@ -0,0 +1,68 @@
package pumpkin:plugin@0.1.0;
interface entity-statuses {
enum entity-status {
armadillo-peek,
armorstand-wobble,
body-break,
cancel-shake-wetness,
chest-break,
death,
dolphin-looking-for-treasure,
drown-particles,
eat-grass,
end-ram,
feet-break,
fireworks-explode,
fishing-rod-reel-in,
fox-eat,
full-debug-info,
guardian-attack-sound,
head-break,
honey-jump,
honey-slide,
in-love-hearts,
jump,
kinetic-hit,
legs-break,
love-hearts,
mainhand-break,
offer-flower,
offhand-break,
permission-level-admins,
permission-level-all,
permission-level-gamemasters,
permission-level-moderators,
permission-level-owners,
poof,
protected-from-death,
ravager-roared,
ravager-stunned,
reduced-debug-info,
saddle-break,
shake,
shake-wetness,
silverfish-merge-anim,
sniffer-digging-sound,
sonic-charge,
squid-anim-synch,
start-attacking,
start-ram,
stop-attacking,
stop-offer-flower,
swap-hands,
taming-failed,
taming-succeeded,
teleport,
tendrils-shiver,
tnt-prime,
trusting-failed,
trusting-succeeded,
use-item-complete,
villager-angry,
villager-happy,
villager-sweat,
witch-hat-magic,
zombie-converting,
}
}
@@ -0,0 +1,164 @@
package pumpkin:plugin@0.1.0;
interface entity-types {
enum entity-type {
acacia-boat,
acacia-chest-boat,
allay,
area-effect-cloud,
armadillo,
armor-stand,
arrow,
axolotl,
bamboo-chest-raft,
bamboo-raft,
bat,
bee,
birch-boat,
birch-chest-boat,
blaze,
block-display,
bogged,
breeze,
breeze-wind-charge,
camel,
camel-husk,
cat,
cave-spider,
cherry-boat,
cherry-chest-boat,
chest-minecart,
chicken,
cod,
command-block-minecart,
copper-golem,
cow,
creaking,
creeper,
dark-oak-boat,
dark-oak-chest-boat,
dolphin,
donkey,
dragon-fireball,
drowned,
egg,
elder-guardian,
end-crystal,
ender-dragon,
ender-pearl,
enderman,
endermite,
evoker,
evoker-fangs,
experience-bottle,
experience-orb,
eye-of-ender,
falling-block,
fireball,
firework-rocket,
fishing-bobber,
fox,
frog,
furnace-minecart,
ghast,
giant,
glow-item-frame,
glow-squid,
goat,
guardian,
happy-ghast,
hoglin,
hopper-minecart,
horse,
husk,
illusioner,
interaction,
iron-golem,
item,
item-display,
item-frame,
jungle-boat,
jungle-chest-boat,
leash-knot,
lightning-bolt,
lingering-potion,
llama,
llama-spit,
magma-cube,
mangrove-boat,
mangrove-chest-boat,
mannequin,
marker,
minecart,
mooshroom,
mule,
nautilus,
oak-boat,
oak-chest-boat,
ocelot,
ominous-item-spawner,
painting,
pale-oak-boat,
pale-oak-chest-boat,
panda,
parched,
parrot,
phantom,
pig,
piglin,
piglin-brute,
pillager,
player,
polar-bear,
pufferfish,
rabbit,
ravager,
salmon,
sheep,
shulker,
shulker-bullet,
silverfish,
skeleton,
skeleton-horse,
slime,
small-fireball,
sniffer,
snow-golem,
snowball,
spawner-minecart,
spectral-arrow,
spider,
splash-potion,
spruce-boat,
spruce-chest-boat,
squid,
stray,
strider,
sulfur-cube,
tadpole,
text-display,
tnt,
tnt-minecart,
trader-llama,
trident,
tropical-fish,
turtle,
vex,
villager,
vindicator,
wandering-trader,
warden,
wind-charge,
witch,
wither,
wither-skeleton,
wither-skull,
wolf,
zoglin,
zombie,
zombie-horse,
zombie-nautilus,
zombie-villager,
zombified-piglin,
}
}
@@ -0,0 +1 @@
interface entity { use %world.{entity, living-entity, mob, path-node-type, dye-color, villager-profession, mob-data, sheep-data, wolf-data, cat-data, villager-data, creeper-data, slime-data, enderman-data, iron-golem-data, fox-data, ageable-data, zombie-data, shulker-data, raycast-result, ray-trace-block-result, ray-trace-entity-result, block-direction}; }
File diff suppressed because it is too large. Load diff
+51
View File
@@ -0,0 +1,51 @@
interface forms {
use text.{text-component};
enum image-type {
url,
path,
}
record form-image {
%type: image-type,
data: string,
}
record simple-form-button {
text: text-component,
image: option<form-image>,
}
record simple-form {
title: text-component,
content: text-component,
buttons: list<simple-form-button>,
}
record modal-form {
title: text-component,
content: text-component,
button1: text-component,
button2: text-component,
}
variant custom-form-element {
label(text-component),
toggle(tuple<text-component, bool>),
slider(tuple<text-component, f32, f32, f32, f32>), // text, min, max, step, default
step-slider(tuple<text-component, list<string>, u32>), // text, steps, default
dropdown(tuple<text-component, list<string>, u32>), // text, options, default
input(tuple<text-component, string, string>), // text, placeholder, default
}
record custom-form {
title: text-component,
elements: list<custom-form-element>,
}
variant form {
simple(simple-form),
modal(modal-form),
custom(custom-form),
}
}
@@ -0,0 +1,67 @@
package pumpkin:plugin@0.1.0;
interface game-events {
enum game-event {
block-activate,
block-attach,
block-change,
block-close,
block-deactivate,
block-destroy,
block-detach,
block-open,
block-place,
bounce,
container-close,
container-open,
drink,
eat,
elytra-glide,
entity-damage,
entity-die,
entity-dismount,
entity-interact,
entity-mount,
entity-place,
entity-action,
equip,
explode,
flap,
fluid-pickup,
fluid-place,
hit-ground,
instrument-play,
item-interact-finish,
item-interact-start,
jukebox-play,
jukebox-stop-play,
lightning-strike,
note-block-play,
prime-fuse,
projectile-land,
projectile-shoot,
sculk-sensor-tendrils-clicking,
shear,
shriek,
splash,
step,
swim,
teleport,
unequip,
resonate-1,
resonate-2,
resonate-3,
resonate-4,
resonate-5,
resonate-6,
resonate-7,
resonate-8,
resonate-9,
resonate-10,
resonate-11,
resonate-12,
resonate-13,
resonate-14,
resonate-15,
}
}
@@ -0,0 +1,69 @@
package pumpkin:plugin@0.1.0;
interface game-rules {
enum game-rule {
advance-time,
advance-weather,
allow-entering-nether-using-portals,
block-drops,
block-explosion-drop-decay,
command-block-output,
command-blocks-work,
drowning-damage,
elytra-movement-check,
ender-pearls-vanish-on-death,
entity-drops,
fall-damage,
fire-damage,
fire-spread-radius-around-player,
forgive-dead-players,
freeze-damage,
global-sound-events,
immediate-respawn,
keep-inventory,
lava-source-conversion,
limited-crafting,
locator-bar,
log-admin-commands,
max-block-modifications,
max-command-forks,
max-command-sequence-length,
max-entity-cramming,
max-minecart-speed,
max-snow-accumulation-height,
mob-drops,
mob-explosion-drop-decay,
mob-griefing,
natural-health-regeneration,
player-movement-check,
players-nether-portal-creative-delay,
players-nether-portal-default-delay,
players-sleeping-percentage,
projectiles-can-break-blocks,
pvp,
raids,
random-tick-speed,
reduced-debug-info,
respawn-radius,
send-command-feedback,
show-advancement-messages,
show-death-messages,
spawn-mobs,
spawn-monsters,
spawn-patrols,
spawn-phantoms,
spawn-wandering-traders,
spawn-wardens,
spawner-blocks-work,
spectators-generate-chunks,
spread-vines,
tnt-explodes,
tnt-explosion-drop-decay,
universal-anger,
water-source-conversion,
}
variant game-rule-value {
int(s32),
%bool(bool),
}
}
+39
View File
@@ -0,0 +1,39 @@
interface gui {
use text.{text-component};
use common.{click-type};
use item-stack.{item-stack};
use screens.{screen};
use inventory.{inventory};
resource gui {
constructor(%type: screen, title: text-component);
/// Returns the underlying inventory handle for this GUI.
get-inventory: func() -> inventory;
set-item: func(slot: u32, item: item-stack);
get-item: func(slot: u32) -> option<item-stack>;
/// Returns the type of this GUI.
get-type: func() -> screen;
/// Returns the title of this GUI.
get-title: func() -> text-component;
/// Returns the number of slots in this GUI.
get-size: func() -> u32;
/// Clears all items from the GUI.
clear-items: func();
/// Sets whether players can grab items out of the inventory.
set-allow-grab-items: func(allow: bool);
/// Returns whether players can grab items out of the inventory.
get-allow-grab-items: func() -> bool;
/// Sets whether players can put items into the inventory from their own.
set-allow-put-items: func(allow: bool);
/// Returns whether players can put items into the inventory from their own.
get-allow-put-items: func() -> bool;
}
}
+21
View File
@@ -0,0 +1,21 @@
interface i18n {
use common.{locale};
/// Retrieves a translated string from the host.
///
/// # Arguments
/// * `key`: The namespaced translation key (e.g. `pumpkin:my_key`).
/// * `locale`: The target locale.
///
/// # Returns
/// The localized string, falling back to English or the key itself.
translate: func(key: string, locale: locale) -> string;
/// Loads custom translations from a JSON string.
///
/// # Arguments
/// * `namespace`: The namespace to associate these keys with.
/// * `json`: A JSON string containing a flat map of translations.
/// * `locale`: The target locale for these translations.
load-translations: func(namespace: string, json: string, locale: locale);
}
@@ -0,0 +1,78 @@
package pumpkin:plugin@0.1.0;
interface inventory {
use item-stack.{item-stack};
use common.{hand};
/// Common inventory resource used across GUIs, player inventories, and containers.
resource inventory {
/// Returns the number of slots in this inventory.
get-size: func() -> u32;
/// Returns true if all slots in this inventory are empty.
is-empty: func() -> bool;
/// Returns the item in the specified slot index, or none if empty.
get-item: func(slot: u32) -> option<item-stack>;
/// Sets the item in the specified slot index.
set-item: func(slot: u32, item: option<item-stack>);
/// Removes and returns the item in the specified slot index.
remove-item: func(slot: u32) -> option<item-stack>;
/// Clears all items from this inventory.
clear: func();
/// Returns all items in this inventory as a list of slots.
get-all-items: func() -> list<option<item-stack>>;
/// Sets all items in this inventory from a list.
set-all-items: func(items: list<option<item-stack>>);
/// Counts the total number of items with the given ID in this inventory.
count-item: func(item-id: string) -> u32;
/// Checks if the inventory contains at least one item with the given ID.
contains-item: func(item-id: string) -> bool;
}
/// Specialized player inventory handle providing access to main inventory, armor, offhand, and hotbar.
resource player-inventory {
/// Returns the generic 36-slot inventory handle (hotbar + main storage).
as-inventory: func() -> inventory;
/// Returns the item currently held in the specified hand.
get-item-in-hand: func(hand: hand) -> option<item-stack>;
/// Sets the item in the specified hand.
set-item-in-hand: func(hand: hand, item: option<item-stack>);
/// Returns the currently selected hotbar slot index (0-8).
get-selected-slot: func() -> u8;
/// Sets the currently selected hotbar slot index (0-8).
set-selected-slot: func(slot: u8);
/// Armor slot accessors
get-helmet: func() -> option<item-stack>;
set-helmet: func(item: option<item-stack>);
get-chestplate: func() -> option<item-stack>;
set-chestplate: func(item: option<item-stack>);
get-leggings: func() -> option<item-stack>;
set-leggings: func(item: option<item-stack>);
get-boots: func() -> option<item-stack>;
set-boots: func(item: option<item-stack>);
get-off-hand: func() -> option<item-stack>;
set-off-hand: func(item: option<item-stack>);
/// Clears all armor slots.
clear-armor: func();
/// Clears the 36 main inventory slots.
clear-main: func();
/// Clears all slots (main inventory, armor, offhand).
clear-all: func();
}
}
+7
View File
@@ -0,0 +1,7 @@
interface ipc {
type plugin-id = string;
type ipc-message = list<u8>;
// Sends a message to the specified plugin, synchronously receiving a response (or an error).
send-ipc-message: func(recipient: plugin-id, message: ipc-message) -> result<result<ipc-message, string>>;
}
@@ -0,0 +1,104 @@
interface item-stack {
use attributes.{attribute, attribute-modifier};
use data-components.{data-component};
use enchantments.{attribute-modifier-slot, enchantment};
use text.{text-component};
/// Represents an enchantment and its level.
record enchantment-value {
enchantment: enchantment,
level: u32,
}
/// Represents a custom enchantment and its level on an item stack.
record custom-enchantment-value {
enchantment-id: string,
level: u32,
}
/// Represents an attribute modifier applied to an item stack for a specific slot.
record item-attribute-modifier {
attribute: attribute,
modifier: attribute-modifier,
slot: attribute-modifier-slot,
}
/// Represents a data component and its serialized value.
record data-component-value {
component: data-component,
/// The serialized value of the component.
value: list<u8>,
}
use common.{nbt-entry, nbt-tree, nbt-tag};
resource item-stack {
constructor(registry-key: string, count: u8);
/// Returns the unique registry key of the item (e.g., "minecraft:diamond").
get-registry-key: func() -> string;
/// Returns the number of items in the stack.
get-count: func() -> u8;
/// Sets the number of items in the stack.
set-count: func(count: u8);
/// Returns the maximum number of items that can be in this stack.
get-max-count: func() -> u8;
/// Returns all enchantments on this item stack.
get-enchantments: func() -> list<enchantment-value>;
/// Adds an enchantment to this item stack.
add-enchantment: func(enchantment: enchantment, level: u32);
/// Removes an enchantment from this item stack.
remove-enchantment: func(enchantment: enchantment);
/// Returns all custom enchantments on this item stack.
get-custom-enchantments: func() -> list<custom-enchantment-value>;
/// Adds a custom enchantment to this item stack.
add-custom-enchantment: func(enchantment-id: string, level: u32);
/// Removes a custom enchantment from this item stack.
remove-custom-enchantment: func(enchantment-id: string);
/// Returns the level of a custom enchantment on this item stack, if present.
get-custom-enchantment-level: func(enchantment-id: string) -> option<u32>;
/// Returns whether this item stack has a specific custom enchantment.
has-custom-enchantment: func(enchantment-id: string) -> bool;
/// Returns all attribute modifiers on this item stack.
get-attribute-modifiers: func() -> list<item-attribute-modifier>;
/// Adds an attribute modifier to this item stack.
add-attribute-modifier: func(modifier: item-attribute-modifier);
/// Removes all attribute modifiers for a specific attribute from this item stack.
remove-attribute-modifiers: func(attribute: attribute);
/// Clears all custom attribute modifiers from this item stack.
clear-attribute-modifiers: func();
/// Returns the lore of this item stack.
get-lore: func() -> list<text-component>;
/// Sets the lore of this item stack.
set-lore: func(lore: list<text-component>);
/// Adds a line to the lore of this item stack.
add-lore: func(line: text-component);
/// Returns the custom name of this item stack, if set.
get-custom-name: func() -> option<text-component>;
/// Sets the custom name of this item stack.
set-custom-name: func(name: option<text-component>);
/// Sets a namespaced custom data value on this item stack.
set-custom-data: func(namespace: string, key: string, value: nbt-tree);
/// Returns a namespaced custom data value from this item stack, if set.
get-custom-data: func(namespace: string, key: string) -> option<nbt-tree>;
/// Removes a namespaced custom data value from this item stack.
remove-custom-data: func(namespace: string, key: string);
/// Returns whether this item stack has a namespaced custom data value.
has-custom-data: func(namespace: string, key: string) -> bool;
/// Returns all data components on this item stack.
get-components: func() -> list<data-component-value>;
/// Sets a data component on this item stack.
set-component: func(component: data-component, value: list<u8>);
/// Removes a data component from this item stack.
remove-component: func(component: data-component);
}
}
@@ -0,0 +1,155 @@
/// Provides types and utilities for displaying rich dialogs to Java Edition players.
/// These dialogs support various layouts, body elements (text and items),
/// and interactive inputs (checkboxes, text fields, sliders).
interface java-dialogs {
use text.{text-component};
use item-stack.{item-stack};
/// Represents the layout and button configuration of a dialog.
enum dialog-type {
/// A simple dialog with a single "OK" button.
notice,
/// A dialog with "Yes" and "No" buttons.
confirmation,
/// A scrollable list of custom buttons.
multi-action,
/// A list of buttons that open other registered dialogs.
dialog-list,
/// A dedicated menu for displaying server-related links.
server-links,
}
/// Represents an element in the main content area of a dialog.
variant dialog-body {
/// A simple text message.
plain-message(text-component),
/// A visual item display.
item(item-stack),
}
/// Represents an interactive input control in a dialog.
variant dialog-input {
/// A checkbox for true/false states.
%bool(dialog-input-bool),
/// A simple string input field.
%text(dialog-input-text),
/// A slider for numerical input within a range.
number-range(dialog-input-number-range),
/// A multiple-choice selection button.
single-option(dialog-input-single-option),
}
/// A checkbox input control.
record dialog-input-bool {
label: text-component,
default-value: bool,
}
/// A text field input control.
record dialog-input-text {
label: text-component,
placeholder: text-component,
default-value: string,
}
/// A numerical range slider input control.
record dialog-input-number-range {
label: text-component,
min-value: f32,
max-value: f32,
initial-value: f32,
step: f32,
label-format: option<string>,
}
/// A multiple-choice selection input control.
record dialog-input-single-option {
label: text-component,
options: list<text-component>,
initial-index: u32,
}
/// Defines what happens after a dialog is closed.
enum after-action {
/// Returns the player to the previous screen (e.g., keeping an inventory open).
peek,
/// Closes all open screens.
pop,
}
/// Represents a clickable button in a dialog.
record action-button {
text: text-component,
tooltip: option<text-component>,
width: option<u32>,
action: action,
}
/// Represents an action triggered by a button click.
variant action {
/// Opens an external URL.
open-url(string),
/// Triggers a custom server-side callback with an ID and optional payload.
custom-click(custom-click-action),
}
/// Represents a custom server-side action.
record custom-click-action {
/// A unique identifier for the action (sent back to the server).
id: string,
/// Optional binary data to send with the action.
payload: option<list<u8>>,
}
/// Represents a link displayed in a Java Edition dialog.
record link {
/// The label to display for the link.
label: link-label,
/// The URL the link points to.
url: string,
}
/// The label for a link, which can be a built-in type or custom text.
variant link-label {
/// A built-in link type with a predefined icon/label.
built-in(link-type),
/// A custom text component label.
custom(text-component),
}
/// Built-in link types recognized by the Java Edition client.
enum link-type {
bug-report,
community-guidelines,
support,
status,
feedback,
community,
website,
forums,
news,
announcements,
}
/// Represents a dialog shown to a Java Edition player.
record dialog {
/// The main title of the dialog.
title: text-component,
/// The layout type of the dialog.
%type: dialog-type,
/// A list of body elements to display in the main area.
body: list<dialog-body>,
/// A list of interactive input controls.
inputs: list<dialog-input>,
/// A list of clickable buttons (for multi-action and other types).
buttons: list<action-button>,
/// A list of links (primarily for server-links type).
links: list<link>,
/// What to do after the dialog is closed.
after-action: option<after-action>,
/// Whether the player can exit the dialog using the Esc key.
can-close-with-escape: bool,
/// The text shown on buttons that link to/open this dialog.
external-title: option<text-component>,
}
}
File diff suppressed because it is too large. Load diff
+14
View File
@@ -0,0 +1,14 @@
interface logging {
enum level {
trace,
debug,
info,
warn,
error,
}
/// log any general purpose message
log: func(level: level, message: string);
/// This function is meant to be used by the tracing crate.
log-tracing: func(event: list<u8>);
}
@@ -0,0 +1,19 @@
/// Plugin metadata describing the plugin and its compatibility.
interface metadata {
record plugin-metadata {
/// Name of the plugin.
name: string,
/// Plugin version (semver).
version: string,
/// Plugin authors.
authors: list<string>,
/// Short description of the plugin.
description: string,
/// Plugin dependencies.
dependencies: list<string>,
/// Permissions requested by the plugin.
permissions: list<string>,
}
get-metadata: func() -> plugin-metadata;
}
@@ -0,0 +1,131 @@
package pumpkin:plugin@0.1.0;
interface particles {
enum particle {
angry-villager,
block,
block-marker,
bubble,
sulfur-bubbles,
noxious-gas,
noxious-gas-cloud,
geyser,
geyser-base,
geyser-poof,
geyser-plume,
cloud,
copper-fire-flame,
crit,
damage-indicator,
dragon-breath,
dripping-lava,
falling-lava,
landing-lava,
dripping-water,
falling-water,
dust,
dust-color-transition,
effect,
elder-guardian,
enchanted-hit,
enchant,
end-rod,
entity-effect,
explosion-emitter,
explosion,
gust,
small-gust,
gust-emitter-large,
gust-emitter-small,
sonic-boom,
falling-dust,
firework,
fishing,
flame,
infested,
cherry-leaves,
pale-oak-leaves,
tinted-leaves,
sculk-soul,
sculk-charge,
sculk-charge-pop,
soul-fire-flame,
soul,
flash,
happy-villager,
composter,
heart,
instant-effect,
item,
vibration,
trail,
pause-mob-growth,
reset-mob-growth,
item-slime,
item-cobweb,
item-snowball,
large-smoke,
lava,
mycelium,
note,
poof,
portal,
rain,
smoke,
white-smoke,
sneeze,
spit,
squid-ink,
sweep-attack,
totem-of-undying,
underwater,
splash,
witch,
bubble-pop,
current-down,
bubble-column-up,
nautilus,
dolphin,
campfire-cosy-smoke,
campfire-signal-smoke,
dripping-honey,
falling-honey,
landing-honey,
falling-nectar,
falling-spore-blossom,
ash,
crimson-spore,
warped-spore,
spore-blossom-air,
dripping-obsidian-tear,
falling-obsidian-tear,
landing-obsidian-tear,
reverse-portal,
white-ash,
small-flame,
snowflake,
dripping-dripstone-lava,
falling-dripstone-lava,
dripping-dripstone-water,
falling-dripstone-water,
glow-squid-ink,
glow,
wax-on,
wax-off,
electric-spark,
scrape,
shriek,
egg-crack,
dust-plume,
trial-spawner-detection,
trial-spawner-detection-ominous,
vault-connection,
dust-pillar,
ominous-spawning,
raid-omen,
trial-omen,
block-crumble,
firefly,
sulfur-cube-goo,
}
}
@@ -0,0 +1,46 @@
interface permission {
/// Represents the player's permission level
///
/// Permission levels determine the player's access to commands and server operations.
/// Each numeric level corresponds to a specific role:
/// - `Zero`: `normal`: Player can use basic commands.
/// - `One`: `moderator`: Player can bypass spawn protection.
/// - `Two`: `gamemaster`: Player or executor can use more commands and player can use command blocks.
/// - `Three`: `admin`: Player or executor can use commands related to multiplayer management.
/// - `Four`: `owner`: Player or executor can use all of the commands, including commands related to server management.
enum permission-level {
zero,
one,
two,
three,
four,
}
/// Describes the default behavior for permissions
variant permission-default {
/// Permission is not granted by default
deny,
/// Permission is granted by default
allow,
/// Permission is granted by default to operators
op(permission-level),
}
/// A child permission entry
record permission-child {
node: string,
value: bool,
}
/// Defines a permission node in the system
record permission {
/// The full node name (e.g., "minecraft:command.gamemode")
node: string,
/// Description of what this permission does
description: string,
/// The default value of this permission
default: permission-default,
/// Children nodes that are affected by this permission
children: list<permission-child>,
}
}
File diff suppressed because it is too large. Load diff
+121
View File
@@ -0,0 +1,121 @@
/// The main entry point for a Pumpkin plugin.
/// This world defines the exports that the plugin must provide to the host
/// and the imports that the host provides to the plugin.
package pumpkin:plugin@0.1.0;
world plugin {
use context.{context};
use event.{event};
use server.{server as server-instance};
use command.{command-sender, consumed-args, command-error, command-suggestions, suggestion-request};
use %world.{entity, chunk-buffer, generation-phase};
use ipc.{plugin-id, ipc-message};
// --- Host-provided imports ---
/// Provides logging capabilities to the plugin.
import logging;
/// Provides GUI creation and management.
import gui;
/// Provides scoreboard management.
import scoreboard;
/// Provides global server information and player lookup.
import server;
/// Provides text component building and formatting.
import text;
/// Provides command registration and argument parsing.
import command;
/// Provides the plugin execution context.
import context;
/// Provides internationalization and translation support.
import i18n;
/// Provides task scheduling for delayed or repeating logic.
import scheduler;
/// Provides world information and block manipulation.
import %world;
/// Provides entity types and manipulation.
import entity;
/// Provides boss bar creation and management.
import boss-bar;
/// Provides Bedrock custom forms.
import forms;
/// Provides Java Edition dialogs.
import java-dialogs;
/// Provides status effect types and instances.
import status-effect;
/// Provides block entity types and instances.
import block-entity;
/// Provides 1 : 1 inter-plugin communication
import ipc;
/// Provides entity attribute types and modifiers.
import attributes;
/// Provides player management.
import player;
/// Provides advancement definitions and progress types.
import advancement;
/// Provides custom recipe registration and management.
import recipe;
/// Provides inventory manipulation and management.
import inventory;
/// Provides datapack inspection and management.
import datapack;
/// Provides custom enchantment registration and management.
import enchantments;
/// Provides damage types.
import damage-types;
/// Provides screen / window types for GUIs and containers.
import screens;
/// Provides player statistics categories and types.
import statistics;
/// Provides Display and Interaction entities.
import display;
/// Provides game rules definitions and queries.
import game-rules;
/// Provides game event types.
import game-events;
/// Provides potion types.
import potions;
/// Provides entity status / animation event types.
import entity-statuses;
// --- Plugin-provided exports ---
/// Called by the host once to initialize the plugin.
/// Internal use only; plugins should use the `register_plugin!` macro.
export init-plugin: func();
/// Called when the plugin is being loaded.
/// Use this to register commands, events, and perform initial setup.
export on-load: func(context: context) -> result<_, string>;
/// Called when the plugin is being unloaded.
/// Use this to save data and clean up resources.
export on-unload: func(context: context) -> result<_, string>;
/// Provides plugin metadata (name, version, etc.) to the host.
export metadata;
/// Dispatches an event to the plugin for handling.
export handle-event: func(event-id: u32, server: server-instance, event: event) -> event;
/// Dispatches a command execution to the plugin.
export handle-command: func(command-id: u32, sender: command-sender, server: server-instance, args: consumed-args) -> result<s32, command-error>;
/// Dispatches a command suggestion request to the plugin.
export handle-command-suggestion: func(handler-id: u32, sender: command-sender, server: server-instance, request: suggestion-request) -> command-suggestions;
/// Dispatches a scheduled task execution to the plugin.
export handle-task: func(handler-id: u32, server: server-instance);
/// Processes an incoming message from another plugin if possible, and returns (a possibly empty) response.
export handle-ipc-message: func(sender: plugin-id, message: ipc-message) -> result<ipc-message, string>;
export handle-ai-goal-can-start: func(goal-id: u32, server: server-instance, entity: entity) -> bool;
export handle-ai-goal-should-continue: func(goal-id: u32, server: server-instance, entity: entity) -> bool;
export handle-ai-goal-start: func(goal-id: u32, server: server-instance, entity: entity);
export handle-ai-goal-tick: func(goal-id: u32, server: server-instance, entity: entity);
export handle-ai-goal-stop: func(goal-id: u32, server: server-instance, entity: entity);
/// Dispatches a chunk generation phase to the plugin.
export handle-generate-phase: func(generator-id: u32, phase: generation-phase, chunk: chunk-buffer);
}
@@ -0,0 +1,52 @@
package pumpkin:plugin@0.1.0;
interface potions {
enum potion-type {
water,
mundane,
thick,
awkward,
night-vision,
long-night-vision,
invisibility,
long-invisibility,
leaping,
long-leaping,
strong-leaping,
fire-resistance,
long-fire-resistance,
swiftness,
long-swiftness,
strong-swiftness,
slowness,
long-slowness,
strong-slowness,
turtle-master,
long-turtle-master,
strong-turtle-master,
water-breathing,
long-water-breathing,
healing,
strong-healing,
harming,
strong-harming,
poison,
long-poison,
strong-poison,
regeneration,
long-regeneration,
strong-regeneration,
strength,
long-strength,
strong-strength,
weakness,
long-weakness,
luck,
slow-falling,
long-slow-falling,
wind-charged,
weaving,
oozing,
infested,
}
}
+88
View File
@@ -0,0 +1,88 @@
interface recipe {
use item-stack.{item-stack};
/// Recipe category for the recipe book.
enum recipe-category {
building,
redstone,
equipment,
misc,
food,
blocks,
}
/// Represents an ingredient in a recipe.
variant ingredient {
/// A specific item (e.g. "minecraft:diamond").
item(string),
/// A tag group of items (e.g., "minecraft:logs").
tag(string),
/// One of multiple specific items.
one-of(list<string>),
}
/// Represents a shaped crafting recipe.
record shaped-recipe {
/// The pattern of the recipe (e.g., ["# #", " s ", "# #"]).
pattern: list<string>,
/// Mapping of characters in the pattern to ingredients.
key: list<tuple<string, ingredient>>,
/// The resulting item stack.
output: item-stack,
/// The recipe group (optional).
group: option<string>,
/// The recipe category in the recipe book.
category: option<recipe-category>,
/// Whether to show a toast notification when the recipe is unlocked.
show-notification: option<bool>,
}
/// Represents a shapeless crafting recipe.
record shapeless-recipe {
/// The list of ingredients required.
ingredients: list<ingredient>,
/// The resulting item stack.
output: item-stack,
/// The recipe group (optional).
group: option<string>,
/// The recipe category in the recipe book.
category: option<recipe-category>,
}
/// Represents a cooking recipe (Smelting, Blasting, Smoking, Campfire).
record cooking-recipe {
/// The ingredient to cook.
ingredient: ingredient,
/// The resulting item stack.
output: item-stack,
/// Experience points awarded.
experience: f32,
/// Cooking time in ticks.
cooking-time: u32,
/// The recipe group (optional).
group: option<string>,
/// The recipe category in the recipe book.
category: option<recipe-category>,
}
/// Types of cooking stations.
enum cooking-type {
smelting,
blasting,
smoking,
campfire,
}
/// Common interface for registering recipes.
resource recipe-manager {
/// Registers a shaped crafting recipe.
register-shaped: func(id: string, recipe: shaped-recipe);
/// Registers a shapeless crafting recipe.
register-shapeless: func(id: string, recipe: shapeless-recipe);
/// Registers a cooking recipe.
register-cooking: func(id: string, station-type: cooking-type, recipe: cooking-recipe);
}
}
@@ -0,0 +1,24 @@
/// Provides functionality to schedule tasks to be executed later on the server.
interface scheduler {
/// Schedules a task to be executed once after the specified number of ticks.
///
/// * `handler-id`: The unique ID of the handler to call when the task executes.
/// * `delay-ticks`: The number of game ticks to wait before execution (20 ticks = 1 second).
///
/// Returns a unique task ID that can be used to cancel the task.
schedule-delayed-task: func(handler-id: u32, delay-ticks: u64) -> u32;
/// Schedules a task to be executed repeatedly.
///
/// * `handler-id`: The unique ID of the handler to call when the task executes.
/// * `delay-ticks`: The number of game ticks to wait before the first execution.
/// * `period-ticks`: The number of game ticks between subsequent executions.
///
/// Returns a unique task ID that can be used to cancel the task.
schedule-repeating-task: func(handler-id: u32, delay-ticks: u64, period-ticks: u64) -> u32;
/// Cancels a scheduled task if it hasn't finished yet.
///
/// * `task-id`: The ID of the task to cancel.
cancel-task: func(task-id: u32);
}
@@ -0,0 +1,111 @@
interface scoreboard {
use text.{text-component};
use common.{named-color};
enum render-type {
integer,
hearts
}
variant number-format {
blank,
fixed(text-component),
}
enum display-slot {
player-list,
sidebar,
below-name,
sidebar-team-black,
sidebar-team-dark-blue,
sidebar-team-dark-green,
sidebar-team-dark-aqua,
sidebar-team-dark-red,
sidebar-team-dark-purple,
sidebar-team-gold,
sidebar-team-gray,
sidebar-team-dark-gray,
sidebar-team-blue,
sidebar-team-green,
sidebar-team-aqua,
sidebar-team-red,
sidebar-team-light-purple,
sidebar-team-yellow,
sidebar-team-white,
}
enum nametag-visibility {
always,
never,
hide-for-other-teams,
hide-for-own-team
}
enum collision-rule {
always,
never,
push-other-teams,
push-own-team
}
record team-settings {
display-name: text-component,
friendly-fire: bool,
see-friendly-invisibles: bool,
nametag-visibility: nametag-visibility,
collision-rule: collision-rule,
color: named-color,
prefix: text-component,
suffix: text-component
}
resource scoreboard {
add-objective: func(name: string, display-name: text-component, render-type: render-type, number-format: option<number-format>);
update-objective: func(name: string, display-name: text-component, render-type: render-type, number-format: option<number-format>);
remove-objective: func(name: string);
set-display-slot: func(slot: display-slot, objective-name: string);
clear-display-slot: func(slot: display-slot);
update-score: func(entity-name: string, objective-name: string, value: s32, number-format: option<number-format>);
add-score: func(entity-name: string, objective-name: string, delta: s32) -> s32;
remove-score: func(entity-name: string, objective-name: string);
reset-entity-scores: func(entity-name: string);
create-team: func(name: string, settings: team-settings);
remove-team: func(name: string);
update-team: func(name: string, settings: team-settings);
add-player-to-team: func(team-name: string, player-name: string);
remove-player-from-team: func(team-name: string, player-name: string);
clear-team-players: func(team-name: string);
get-teams: func() -> list<string>;
get-team: func(name: string) -> option<team-settings>;
get-team-players: func(team-name: string) -> list<string>;
get-player-team: func(player-name: string) -> option<string>;
}
enum bedrock-sort-order {
ascending,
descending
}
enum bedrock-display-slot {
player-list,
sidebar,
below-name
}
resource bedrock-scoreboard {
add-objective: func(name: string, display-name: string, sort-order: bedrock-sort-order);
update-objective: func(name: string, display-name: string, sort-order: bedrock-sort-order);
remove-objective: func(name: string);
set-display-slot: func(slot: bedrock-display-slot, objective-name: string);
clear-display-slot: func(slot: bedrock-display-slot);
update-score: func(entity-name: string, objective-name: string, value: s32);
add-score: func(entity-name: string, objective-name: string, delta: s32) -> s32;
remove-score: func(entity-name: string, objective-name: string);
reset-entity-scores: func(entity-name: string);
}
}
@@ -0,0 +1,31 @@
package pumpkin:plugin@0.1.0;
interface screens {
enum screen {
generic-9x1,
generic-9x2,
generic-9x3,
generic-9x4,
generic-9x5,
generic-9x6,
generic-3x3,
crafter-3x3,
anvil,
beacon,
blast-furnace,
brewing-stand,
crafting,
enchantment,
furnace,
grindstone,
hopper,
lectern,
loom,
merchant,
shulker-box,
smithing,
smoker,
cartography-table,
stonecutter,
}
}
+286
View File
@@ -0,0 +1,286 @@
interface server {
use player.{player, ban-player-options, ban-ip-options, server-link, known-server-link, server-link-label};
use common.{game-mode};
use %world.{%world};
use text.{text-component};
use uuid.{uuid};
use recipe.{recipe-manager};
use enchantments.{enchantment-manager, custom-enchantment};
use permission.{permission-level};
use advancement.{advancement-info};
use datapack.{datapack-manager, datapack-info};
/// Represents an operator entry in the ops configuration.
record op-entry {
uuid: uuid,
name: string,
level: permission-level,
bypasses-player-limit: bool,
}
/// Interface for querying and managing server operators.
resource op-manager {
/// Checks if a player UUID is currently an operator.
is-op: func(id: uuid) -> bool;
/// Retrieves the operator entry for a player UUID, if present.
get-op: func(id: uuid) -> option<op-entry>;
/// Gets the effective permission level for a player UUID (returns zero if not op).
get-permission-level: func(id: uuid) -> permission-level;
/// Grants operator status to a player (online or offline) with the specified level and bypass setting.
op-player: func(name: string, id: uuid, level: permission-level, bypasses-player-limit: bool);
/// Revokes operator status from a player (online or offline). Returns true if the player was previously op.
deop-player: func(id: uuid) -> bool;
/// Returns a list of all operator entries on the server.
list-ops: func() -> list<op-entry>;
}
/// Represents a banned player entry in the ban list.
record banned-player-entry {
uuid: uuid,
name: string,
created: string,
source: string,
expires: option<string>,
reason: string,
}
/// Represents a banned IP entry in the IP ban list.
record banned-ip-entry {
ip: string,
created: string,
source: string,
expires: option<string>,
reason: string,
}
/// Global manager for player and IP bans.
resource ban-manager {
/// Checks if a player UUID is currently banned.
is-player-banned: func(id: uuid) -> bool;
/// Retrieves the ban entry for a player UUID, if banned.
get-player-ban: func(id: uuid) -> option<banned-player-entry>;
/// Bans a player by name and UUID with the specified options (works for online and offline players).
ban-player: func(name: string, id: uuid, options: ban-player-options);
/// Removes a player ban by UUID. Returns true if the player was banned.
unban-player: func(id: uuid) -> bool;
/// Returns all currently active player bans.
list-player-bans: func() -> list<banned-player-entry>;
/// Checks if an IP address is currently banned.
is-ip-banned: func(ip: string) -> bool;
/// Retrieves the ban entry for an IP address, if banned.
get-ip-ban: func(ip: string) -> option<banned-ip-entry>;
/// Bans an IP address with the specified options.
ban-ip: func(ip: string, options: ban-ip-options);
/// Removes an IP ban. Returns true if the IP was banned.
unban-ip: func(ip: string) -> bool;
/// Returns all currently active IP bans.
list-ip-bans: func() -> list<banned-ip-entry>;
}
/// Represents a player entry in the server whitelist.
record whitelist-entry {
uuid: uuid,
name: string,
}
/// Global manager for the server whitelist.
resource whitelist-manager {
/// Returns whether the whitelist is currently enabled.
is-enabled: func() -> bool;
/// Enables or disables the server whitelist. If enabled and enforce-whitelist is set, kicks non-whitelisted players.
set-enabled: func(enabled: bool);
/// Checks if a player UUID is on the whitelist.
is-whitelisted: func(id: uuid) -> bool;
/// Adds a player to the whitelist (online or offline). Returns true if newly added.
add-player: func(name: string, id: uuid) -> bool;
/// Removes a player from the whitelist. Returns true if the player was on the whitelist.
remove-player: func(id: uuid) -> bool;
/// Returns all whitelisted player entries.
list-entries: func() -> list<whitelist-entry>;
}
/// Represents the difficulty setting of a Minecraft server.
enum difficulty {
/// Hostile mobs do not spawn. Players regain health automatically.
peaceful,
/// Hostile mobs deal less damage.
easy,
/// Standard Minecraft difficulty.
normal,
/// Hostile mobs deal more damage.
hard,
}
/// Represents the three main Minecraft dimensions.
enum dimension {
overworld,
nether,
end,
}
record sys-info {
cpu-count: option<u32>,
total-memory: option<u64>,
used-memory: option<u64>,
os-name: option<string>,
os-version: option<string>,
pumpkin-version: string,
}
variant command-sender {
console,
player(player),
}
/// Represents the global server instance.
resource server {
/// Returns system information (CPU, Memory, OS).
/// Fields are returned only if the plugin has the corresponding permissions.
get-sys-info: func() -> sys-info;
/// Returns the current difficulty level of the server.
get-difficulty: func() -> difficulty;
/// Returns the total number of players currently connected to the server.
get-player-count: func() -> u32;
/// Returns the rolling average Milliseconds Per Tick (MSPT).
/// A value below 50.0 is required for a stable 20 TPS.
get-mspt: func() -> f64;
/// Returns the effective Ticks Per Second (TPS).
/// Ideal value is 20.0.
get-tps: func() -> f64;
/// Returns a list of all online players across all worlds.
get-all-players: func() -> list<player>;
/// Searches for a player by their exact name.
get-player-by-name: func(name: string) -> option<player>;
/// Searches for a player by their UUID string.
get-player-by-uuid: func(id: uuid) -> option<player>;
/// Returns a list of all worlds on this server.
get-all-worlds: func() -> list<%world>;
/// Gets a world by its dimension name (e.g., "minecraft:overworld") or custom world name (e.g., "world", "arena_1").
get-world-by-name: func(name: string) -> option<%world>;
/// Checks if a world exists by name or dimension.
has-world: func(name: string) -> bool;
execute-command: func(command: string, sender: command-sender);
/// Creates or loads a world by its name and dimension.
/// If a world with the given name already exists, it will be returned.
create-world: func(name: string, dimension: dimension) -> %world;
/// Unloads and saves a world by its name or dimension.
/// Returns an error if the world cannot be found, is the primary/default world, or still has players inside.
unload-world: func(name: string) -> result<_, string>;
/// Saves all players, player advancements, and loaded worlds to disk.
save-all: func() -> result<_, string>;
/// Returns a list of all online players in a specific world.
get-players-in-world: func(world-ref: %world) -> list<player>;
/// Returns the number of online players in a specific world.
get-player-count-in-world: func(world-ref: %world) -> u32;
/// Broadcasts a system chat message to all players.
broadcast: func(message: string);
/// Deletes a signed chat message from all players' chat windows using its 256-byte signature.
delete-message-by-signature: func(signature: list<u8>);
/// Deletes a signed chat message from all players' chat windows using its signature cache ID.
delete-message-by-id: func(signature-id: s32);
/// Broadcasts a tab list header and footer to all players.
broadcast-tab-list-header-footer: func(header: text-component, footer: text-component);
/// Returns the maximum number of players allowed on the server.
get-max-players: func() -> u32;
/// Returns whether the server is in hardcore mode.
is-hardcore: func() -> bool;
/// Returns whether the server is in online mode (authenticates with Mojang).
is-online-mode: func() -> bool;
/// Returns the server's Message of the Day (MOTD).
get-motd: func() -> string;
/// Returns whether the server has a whitelist enabled.
has-whitelist: func() -> bool;
/// Returns whether the server allows the Nether dimension.
get-allow-nether: func() -> bool;
/// Returns whether the server allows the End dimension.
get-allow-end: func() -> bool;
/// Returns the server's maximum view distance.
get-view-distance: func() -> u8;
/// Returns the server's maximum simulation distance.
get-simulation-distance: func() -> u8;
/// Returns the server's default gamemode.
get-default-gamemode: func() -> game-mode;
/// Returns the recipe manager to register custom recipes.
get-recipe-manager: func() -> recipe-manager;
/// Returns the operator manager to query or modify server operators.
get-op-manager: func() -> op-manager;
/// Returns the global ban manager for querying and modifying player and IP bans.
get-ban-manager: func() -> ban-manager;
/// Returns the global whitelist manager for querying and modifying the server whitelist.
get-whitelist-manager: func() -> whitelist-manager;
/// Returns detailed information about an advancement by its ID (e.g., "minecraft:story/mine_stone" or "story/mine_stone").
get-advancement: func(id: string) -> option<advancement-info>;
/// Returns a list of all registered advancement IDs on the server.
get-all-advancement-ids: func() -> list<string>;
/// Returns the global enchantment manager for registering and querying custom enchantments.
get-enchantment-manager: func() -> enchantment-manager;
/// Returns information about an enchantment by its ID (vanilla or custom).
get-enchantment: func(id: string) -> option<custom-enchantment>;
/// Returns a list of all registered enchantment IDs (custom and vanilla) on the server.
get-all-enchantment-ids: func() -> list<string>;
/// Returns the global datapack manager for inspecting, enabling, disabling, and reloading datapacks.
get-datapack-manager: func() -> datapack-manager;
/// Broadcasts custom server links to all connected players (displayed in the client Esc pause menu in 1.21+).
set-server-links: func(links: list<server-link>);
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,94 @@
package pumpkin:plugin@0.1.0;
interface statistics {
enum statistic-category {
mined,
crafted,
used,
broken,
picked-up,
dropped,
killed,
killed-by,
custom,
}
enum custom-statistic {
leave-game,
play-time,
total-world-time,
time-since-death,
time-since-rest,
sneak-time,
walk-one-cm,
crouch-one-cm,
sprint-one-cm,
walk-on-water-one-cm,
fall-one-cm,
climb-one-cm,
fly-one-cm,
walk-under-water-one-cm,
minecart-one-cm,
boat-one-cm,
pig-one-cm,
happy-ghast-one-cm,
horse-one-cm,
aviate-one-cm,
swim-one-cm,
strider-one-cm,
nautilus-one-cm,
jump,
drop,
damage-dealt,
damage-dealt-absorbed,
damage-dealt-resisted,
damage-taken,
damage-blocked-by-shield,
damage-absorbed,
damage-resisted,
deaths,
mob-kills,
animals-bred,
player-kills,
fish-caught,
talked-to-villager,
traded-with-villager,
eat-cake-slice,
fill-cauldron,
use-cauldron,
clean-armor,
clean-banner,
clean-shulker-box,
interact-with-brewingstand,
interact-with-beacon,
inspect-dropper,
inspect-hopper,
inspect-dispenser,
play-noteblock,
tune-noteblock,
pot-flower,
trigger-trapped-chest,
open-enderchest,
enchant-item,
play-record,
interact-with-furnace,
interact-with-crafting-table,
open-chest,
sleep-in-bed,
open-shulker-box,
open-barrel,
interact-with-blast-furnace,
interact-with-smoker,
interact-with-lectern,
interact-with-campfire,
interact-with-cartography-table,
interact-with-loom,
interact-with-stonecutter,
bell-ring,
raid-trigger,
raid-win,
interact-with-anvil,
interact-with-grindstone,
target-hit,
interact-with-smithing-table,
}
}
@@ -0,0 +1,54 @@
package pumpkin:plugin@0.1.0;
interface status-effect {
enum status-effect-type {
speed,
slowness,
haste,
mining-fatigue,
strength,
instant-health,
instant-damage,
jump-boost,
nausea,
regeneration,
resistance,
fire-resistance,
water-breathing,
invisibility,
blindness,
night-vision,
hunger,
weakness,
poison,
wither,
health-boost,
absorption,
saturation,
glowing,
levitation,
luck,
unluck,
slow-falling,
conduit-power,
dolphins-grace,
bad-omen,
hero-of-the-village,
darkness,
trial-omen,
raid-omen,
wind-charged,
weaving,
oozing,
infested,
}
record status-effect-instance {
effect-type: status-effect-type,
duration: u32,
amplifier: u8,
ambient: bool,
show-particles: bool,
show-icon: bool,
}
}
+68
View File
@@ -0,0 +1,68 @@
interface text {
use common.{named-color, rgb-color, argb-color};
resource text-component {
/// Creates a plain text component.
text: static func(plain: string) -> text-component;
/// Creates a translation component.
translate: static func(key: string, %with: list<text-component>) -> text-component;
/// Creates a translation component with a Bedrock-specific fallback key.
translate-cross: static func(java-key: string, bedrock-key: string, %with: list<text-component>) -> text-component;
/// Creates an entity names / selector text component.
entity-names: static func(selector: string, separator: option<string>) -> text-component;
/// Creates a keybind text component (e.g., "key.jump").
keybind: static func(keybind: string) -> text-component;
/// Creates a custom translation component.
custom: static func(namespace: string, key: string, locale: string, %with: list<text-component>) -> text-component;
/// Parses a legacy Minecraft formatted string (using section signs '§' by default) into a text component.
from-legacy-string: static func(input: string) -> text-component;
/// Parses a legacy formatted string using a custom color code symbol (e.g. '&' or '§').
from-legacy-string-with-code: static func(input: string, code-symbol: char) -> text-component;
/// Parses a standard Minecraft JSON text component.
from-json: static func(json: string) -> result<text-component, string>;
/// Serializes the text component to JSON format.
to-json: func() -> string;
add-child: func(child: text-component);
add-text: func(text: string);
get-text: func() -> string;
encode: func() -> list<u8>;
to-pretty-console: func() -> string;
// Style
color-named: func(color: named-color);
color-rgb: func(color: rgb-color);
gradient-named: func(colors: list<named-color>);
gradient: func(colors: list<rgb-color>);
rainbow: func();
bold: func(value: bool);
italic: func(value: bool);
underlined: func(value: bool);
strikethrough: func(value: bool);
obfuscated: func(value: bool);
/// Text inserted into chat when shift-clicked
insertion: func(text: string);
font: func(font: string);
shadow-color: func(color: argb-color);
// Click events
click-open-url: func(url: string);
click-open-file: func(path: string);
click-run-command: func(command: string);
click-suggest-command: func(command: string);
click-change-page: func(page: u32);
click-copy-to-clipboard: func(text: string);
// Hover events
hover-show-text: func(text: text-component);
/// Item data as SNBT string
hover-show-item: func(item: string);
hover-show-entity: func(entity-type: string, id: string, name: option<text-component>);
}
}
+16
View File
@@ -0,0 +1,16 @@
interface uuid {
/// A 128-bit UUID represented as two 64-bit integers.
record uuid {
high: u64,
low: u64,
}
/// Generates a new random v4 UUID.
generate: func() -> uuid;
/// Parses a UUID from a string. Returns none if the string is not a valid UUID.
parse: func(s: string) -> option<uuid>;
/// Converts a UUID to its standard string representation.
to-string: func(id: uuid) -> string;
}
File diff suppressed because it is too large. Load diff