A script is a .java file. No class, no imports. It shows up as a module under ClickGUI, in Scripts. Source of truth is the Java API under wsamiaw.script.api.
Trust boundary. Scripts are fully privileged. They can send packets and toggle modules. Only run code you wrote or fully trust.
Start
.script create Radar
Script Writer, or .script writer. Ctrl+S, then Ctrl+R.
ClickGUI, Scripts, turn it on.
Files live in .minecraft/config/Wsamiaw/scripts/. A JDK is best. The jar also ships a compiler fallback.
Chat colors use &a green, &c red, &7 gray, &e yellow, &b aqua, &f white, &8 dark gray, &l bold, &r reset. Draw colors are 0xAARRGGBB — build with host.util.argb(a,r,g,b) or host.util.rgb(r,g,b).
A whole script
Settings are born in onLoad. Everything else reads them by name. host.every is true once per period, so this does not spam chat.
void onLoad() {
host.bool("Whisper", true);
host.slider("Range", 8f, 3f, 32f);
}
void onEnable() {
host.say("&aRadar on");
}
void onUpdate(UpdateEvent e) {
if (!host.on("Whisper") || !host.every("scan", 400)) return;
var p = host.nearest();
if (p == null || p.distance() > host.num("Range")) return;
host.say("&7" + p.name() + " &8" + (int) p.distance() + "m");
}
void onChat(String text) {
if (text.toLowerCase().contains("gg")) host.chat("gg");
}
void onRender2D(Render2DEvent e) {
var g = e.getGraphics();
var p = host.nearest();
String line = p == null ? "alone" : p.name();
host.render.rect(g, 8, 8, 140, 22, 0xCC141413);
host.render.text(g, line, 14, 14, 0xFFE8E6E0);
}
What you actually call
Call
Does
host.bool / slider / choice
Make a ClickGUI setting, inside onLoad
host.on / num / text
Read it later. text on a choice is the label
host.chathost.say
Server chat. A leading / is a command. say stays on your client
host.ground health food hurt ping
You
host.x y z yaw pitch look
Where you are and where you look
host.held count jump sneaking sprinting
Hand, inventory, movement
host.key("w")
w a s d space shift ctrl attack use, or key.keyboard.r
host.every("id", 1000)
True once per period, in milliseconds
host.nearest()host.players()
Other players. p.name()p.distance()
host.raycast(4.5)
Block under the crosshair, or null. .x .y .z .side .block
ClickGUI hooks require host.ui.claim("clickgui"). ESC still closes. The copy button below is the full surface for an AI: do not invent a method it does not list.
host.ui
Native HUD / ClickGUI pass. Claim a surface so the built-in plate hides; release or disable restores it. Colors are 0xAARRGGBB.
Claiming hud also makes owns("hud.arraylist") (and other hud.*) true while the blanket claim is held. Another owner already holding a surface makes claim return false.
Ownership
Method
Returns
Description
claim(surface)
boolean
Take ownership; true if you own it
release(surface)
void
Return the surface to the built-in plate
owns(surface)
boolean
This script owns it, or owns blanket hud for hud.*
Active client theme tokens as ARGB ints. Caveat: every color/radius accessor reads only the active theme’s ClickGUI token group (theme.clickGui.*). HUD-specific sections are not exposed.
Method
Returns
Description
name()
String
Active theme name, or empty
list()
List<String>
Known theme names
set(name)
boolean
Switch active theme without saving
save(name)
boolean
Save a copy under name
accent()
int
Accent (fallback 0xFF4FC3F7)
accentAlt()
int
Secondary accent (fallback 0xFF81C784)
bg()
int
Panel background (fallback 0xF20E0E12)
header()
int
Header strip (fallback 0xFF14141A)
text()
int
Primary text (fallback 0xFFEEEEF4)
textDim()
int
Muted text (fallback 0xFF9494A0)
row()
int
Row background (fallback 0xE6121217)
radius()
float
Corner radius (fallback 9)
setAccent(argb)
void
Live-apply accent without saving
setBg(argb)
void
Live-apply background without saving
There is no setHeader, no HUD palette accessors, and no inventable token beyond this table.
host.player
Method
Returns
Description
present()
boolean
Local player exists
entity()
ScriptEntity
Wrapped local player, or null
name()uuid()
String
Profile identity
x() y() z()
double
Position
pos()
ScriptVec3
Position vector
yaw() pitch()
float
Look angles
setYaw(float)setPitch(float)
void
Set look
eye()
float
Eye height
health() maxHealth()
float
Health
absorption()
float
Absorption
armor()
int
Armor value
air()
int
Air supply
food()
int
Food level
saturation()
float
Saturation
hurt()
int
Hurt time
xp()xpBar()
int / float
Experience
onGround()
boolean
On ground
sprinting()setSprinting(b)
Sprint
sneaking()setSneaking(b)
Sneak
flying()setFlying(b)mayFly()
Flight ability
moving()forward()strafe()
Move input
setMove(strafe, forward)stopMove()
void
Override move vector
motion()motionX/Y/Z()
Velocity
setMotion(x,y,z)setMotionX/Y/Z
void
Set velocity
speed()setSpeed(v)
Horizontal speed
gamemode()gamemode(name)
Get/set local mode
creative() survival() adventure() spectator()
boolean
Mode checks
using() useTicks()
Item use
onFire() inWater() inLava() riding()
boolean
Environment
fall()ticks()
Fall distance / tick count
held()count(id)slot()slot(n)
Hand / inventory
jump() swing() swingOffhand()
void
Actions
attack(entity)attack(entityId)
void
Attack
drop()dropStack()
boolean
Throw items
place()
boolean
Use on looked-at block
raycast(distance)raycast(distance,yaw,pitch)
ScriptHit
Block ray
rayEntity(distance)rayEntity(distance,yaw,pitch)
ScriptEntity
Entity ray
rotationsTo(entity)rotationsTo(x,y,z)
float[]
{yaw,pitch}
serverYaw()serverPitch()
float
Sent look
server()screen()closeScreen()ping()
Session
sendChat(text)clientMessage(text)
void
Chat
effects()potion(id)
Effects
attackStrength()
float
Cooldown cooldown 0..1
target()
ScriptEntity
KillAura target
host.world
Method
Returns
Description
present()
boolean
Level loaded
dimension()
String
Dimension id
time()time(ticks)
Read / set client clock
difficulty()hardcore()
World rules
rain()thunder()rain(f)thunder(f)
Client weather
spawnX() spawnY() spawnZ()
int
Respawn
players()player(name)nearestPlayer()
Players
playersWithin(range)playerCount()
Nearby / count
entities()living()entity(id)
Entities
within(range)livingWithin(range)
Range queries
blockAt(x,y,z)block(x,y,z)
ScriptBlock
Block lookup
air(x,y,z)solid(x,y,z)biome(x,y,z)
Convenience
scoreboard()tab()network()
Sidebar / tab
set clear fill replace walls sphere undo undo(n)
Client-only edits; prefer fill (not host.fill); cap 12000; sphere r ≤ 16
dig dig(side) digStop crack placeAgainst interact
Server-visible actions
spawn remove clearSpawned prop shape
Client entities / props
particle burst explode lightning sound
FX
Block ids accept stone or minecraft:stone. Dig sides: up down north south east west.
.script create <name> writes a file from the short template
.script load compiles everything
.script writer opens the editor. Ctrl+S saves, Ctrl+R compiles
.script enable and disable <name>
.script list.script folder
Prompt for an AI
Paste this into the model before you ask it to write a script. It is the whole easy API, and it tells the model not to invent methods. The file is scripting-prompt.md.