Download Clojure Command Language — Minecraft Mods — MetaMods

Clojure Command Language

Active

Downloads

0

Last update

3 years ago
Client
Fabric
Quilt
Forge
Neoforge
Utils

Clojure Command Language

The Clojure Command Language mod provides a versatile wrapper that extends the capabilities of Minecraft's standard command system by implementing the full-featured Clojure programming language. This solution is Turing-complete, allowing Minecraft commands to utilize programming elements such as variables, loops, conditional statements, and other structures for executing command templates.

Main Commands

The mod adds two key commands: /ccl and /cclfile.

/ccl Command

This command provides access to an interactive command line operating on Clojure. However, for executing complex scenarios, its use is not recommended - the file-based approach is preferable. Minecraft imposes restrictions on the use of slashes in commands, so instead of direct slashes, the '|' symbol should be used, which will be automatically converted before execution.

/cclfile Command

This tool proves much more practical in use. Upon first mod launch, a 'ccl_scripts' folder is automatically created in your modpack's root directory (not inside /config/), where you can place scripts with *.clj extension. The advantage is that after saving a file, it immediately becomes available for use - no reloading is required.

To execute a file located at path /my_modpack/ccl_scripts/sayhi.clj, simply enter the command /cclfile sayhi.

Command execution example

Practical Example

Consider the makeline.clj script demonstrating the mod's capabilities:

(dotimes [x 50]
         (let [meta (mod x 15)]
              (lib/exec ["setblock ~" x " ~0 ~1 wool " meta]))) // Creating a line of blocks

Script execution result

The author acknowledges that Clojure may not suit all users, but currently, there are no plans to change the programming language or add support for other languages.

Project members
Dark_Arcana

Dark_Arcana

Created: 4 Apr 2019

ID: 27470