HomeJavaModsGooseboy
Gooseboy
Gooseboy — screenshot 1Gooseboy — screenshot 2Gooseboy — screenshot 3Gooseboy — screenshot 4Gooseboy — screenshot 5Gooseboy — screenshot 6Gooseboy — screenshot 7

Gooseboy

A tiny game console inside Minecraft

Available for Fabric Requires Fabric API Check out the gallery

This mod allows you to run WebAssembly scripts inside Minecraft on the client safely, allowing the creation of games, programs, and whatever your heart desires.

Note: Scripts are called crates in Gooseboy

Features

Permissions

Every crate by default has very minimal permissions to only the console and the mouse, you can change the permissions for each crate by opening the settings of the crate. The full list of permissions are as follows:

Security

Crates are run using the Java Chicory WASM runtime. For security, crates can't:

If you’ve found a crate that can bypass these restrictions, please report it via GitHub.

How-to open the crates menu

Go in-game, and press M. (you can change the keybinding in the Controls options if you'd like to!)

Where-to find crates

You can find the official example crates here

How-to add a crate

You can add crates by moving them to the crates folder. You can open the crates folder from the menu by pressing the " Open crates folder location" button at the bottom.

How-to create crates

You can make crates in any language that compiles to WebAssembly (WASI is unsupported due to security concerns). The recommended language to use is Rust, and so the standard library is made in Rust as well.

An example crate is as follows:

#![no_main]

use gooseboy::framebuffer::{get_framebuffer_width, init_fb};
use gooseboy::text::{draw_text, get_text_width};
use gooseboy::{color::Color, framebuffer::clear_framebuffer};

// Every crate has to have a main function, make sure to decorate it
// with gooseboy::main though, or else the crate won't start
#[gooseboy::main]
fn main() {
    // Initializes the framebuffer, you are required to initialize this
    // here if you plan to draw to the screen (which is very likely)
    init_fb();
}

// This is also required in every crate, the gooseboy::update is required
// here too, this function runs X times per second where X is equal to your
// maximum framerate in the options
#[gooseboy::update]
fn update(nano_time: i64) {
    // Clear out the screen, erasing everything that was there previously
    clear_framebuffer(Color::BLACK);

    // Initialize the string we want to draw to the screen, You can also use Rust's
    // String type here, with the caveat of having to clone it at draw_text
    let text = "Hello, world!";
    // Convert the time from nanoseconds to seconds
    let time_sec = nano_time as f64 / 1_000_000_000.0;
    // Get the position of the right corner and subtract the width of the text
    // to make the text fit into the screen, You can also use draw_text_wrapped
    // to automatically wrap text if it passes the end of the framebuffer
    let right_corner = (get_framebuffer_width() - get_text_width(text)) as f64;
    // Gets us an X position that smoothly moves from the left to the right using sine
    let x_pos = ((time_sec.sin() * 0.5 + 0.5) * (right_corner - 1.0)) as usize;

    // Finally, draw the text with the red color (or use Color::new(r, g, b, a) or Color::new_opaque(r, g, b))
    draw_text(x_pos, 0, text, Color::RED);
}

Contributing

Want to help improve Gooseboy? Contributions are welcome! You can find the standard library here and the CLI here and the Java mod here!

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more