Skip to content

Client & Server

Minecraft runs in two environments: Client and Server. Understanding the difference is important for modding.

The two sides

SideWhat it runsWhat it does
ClientYour computerRenders graphics, plays sounds, handles input
ServerThe game worldRuns game logic, manages entities, saves data

In singleplayer, both run on your computer but stay logically separate. In multiplayer, you run the Client and connect to a separate Server.

Why this matters

Some code should only run on one side:

CodeSideReason
Register items/blocksBothBoth sides need to know about them
Render a custom modelClient onlyServers do not render graphics
Save player dataServer onlyOnly the server saves data
Open a GUIClient onlyOnly the client shows screens

Script folders

FoundryEngine organizes scripts into three folders matching these sides:

scripts/
├── common/my_bundle/     # Runs everywhere
├── client/my_bundle/     # Runs only on the client
└── server/my_bundle/     # Runs only on the server

Entrypoints per side

Each folder can have its own entrypoint. You do not need all three — only the ones your bundle needs:

groovy
// scripts/common/my_bundle/Entrypoint.groovy
class Entrypoint implements BundleEntrypoint {
    @Override void onLoad() {
        // Register items, blocks, recipes — runs everywhere
    }
}
groovy
// scripts/client/my_bundle/ClientEntrypoint.groovy
class ClientEntrypoint implements BundleEntrypoint {
    @Override void onLoad() {
        // Client-only setup — renderer hooks, keybinds
    }
}
groovy
// scripts/server/my_bundle/ServerEntrypoint.groovy
class ServerEntrypoint implements BundleEntrypoint {
    @Override void onLoad() {
        // Server-only setup — commands, data
    }
}

Quick reference

What you want to doPut it in
Create items, blocks, recipescommon/
React to player join, block breakcommon/
Custom rendering, particlesclient/
GUI, key bindingsclient/
Server commandsserver/
Save/load dataserver/ or common/

Next

FoundryEngine is a work-in-progress. Documentation may change.