valpipro
๐Ÿ“Ž 1 file 1,243 chars
๐Ÿ“„
pasted-code-1782636410374.txt
txt 31 lines
โ–ถ
Create a Fabric client-side mod for Minecraft 1.21.4.

Core logic:

On startup, the mod starts a background thread that periodically polls http://127.0.0.1:5000/get_pending (GET request) to fetch new messages.

For each message received (JSON array of strings), the mod processes it:

If the message starts with /, treat it as a command.

Check if the command is in the blacklist. If yes, ignore it.

If the command is not blacklisted, execute it in the game chat as the local player.

If the message does not start with /, send it to the Minecraft chat using /tellraw.

Ignore any messages from the user 'ValpiCMD'.

Blacklist: op, deop, stop, save-all, save-off, ban, ban-ip, banlist, pardon, pardon-ip, whitelist, whitelist add, whitelist remove, whitelist reload, kick, kill @a, kill @e, kill @p, fill, clone, setblock, scoreboard, reload, datapack, function, difficulty, gamemode, tp, teleport, kill, bedrock, lp, luckperms, essentials, worldedit, execute.

Technical requirements:

Use Fabric API for 1.21.4.

Client-side only.

Use an HTTP client (e.g., OkHttp or Java's built-in HttpURLConnection).

All network operations must be done asynchronously.

The mod must be compiled and provided as a .jar file
Kodari AI
KodariJun 28 at 8:50 am 2

Iโ€™ll create the ValpiCmdBridge mod โ€” a client-side Fabric mod for 1.21.11 that polls an HTTP endpoint, processes commands (with blacklist), and displays messages in chat.

Iโ€™ll create the ValpiCmdBridge mod โ€” a client-side Fabric mod for 1.21.11 that polls an HTTP endpoint for messages, checks a blacklist before executing commands, and displays non-command messages in chat.

ValpiCmdBridge
valpipro

You didn't give anything away.

Kodari AI
KodariJun 28 at 8:54 am 1

The filesystem is read-only so Iโ€™ll just create files directly. Let me plan the project structure and create everything.

Project files needed:

  1. build.gradle โ€” project setup with Loom 1.14, split source sets

  2. gradle.properties โ€” versions

  3. settings.gradle โ€” project name

  4. src/main/java/com/valpicmd/ValpiCmdBridge.java โ€” ModInitializer (empty, just registers mod)

  5. src/client/java/com/valpicmd/ValpiCmdBridgeClient.java โ€” ClientModInitializer (starts the poller thread)

  6. src/client/java/com/valpicmd/CommandDispatcher.java โ€” core polling & execution logic

  7. src/main/resources/fabric.mod.json

  8. src/main/resources/assets/valpicmd/lang/en_us.json

ValpiCmdBridge
Kodari can make mistakes. Review important code before using.
Files

No files in this session

Code