CompuBlock

This project is abandoned and its default file will likely not work with the most recent version of Minecraft. Whether this project is out of date or its author has marked it as abandoned, this project is no longer maintained.

CompuBlock

Any tech-loving Minecraft modder knows of dan200's famous ComputerCraft, in which you can build computers and program them in Lua. CompuBlock is a similar concept created for unmodded Bukkit servers.

Dependencies

This plugin requires Holographic Displays for displaying output

Usage

There are no commands to go with this plugin, so you can start scripting right away! Scripts are written in one of two ways: Either by writing them in a book and quill, where the script can span multiple lines and pages, or by typing the script directly into a command block. To transfer a script into a command block, simply left-click the block with the book and quill. Only players with the "lua" permission set are able to transfer scripts into command blocks, ensuring that only trusted people can write Lua scripts. The scripts are run when the command block receives power.

As far as using Bukkit features in Lua, most of what you need is created dynamically. By default, the Bukkit class and all its methods are loaded, and its method names remain the same.

For example, here is a simple Lua script to change the type of a block:

world = Bukkit.getWorlds().get(0)
block = world.getBlockAt(0, 64, 0)
rand = Random.nextInt(192)
block.setTypeId(rand)

Additional functions include

print(text) -- Takes any number of arguments and prints them to the display
clear() -- Clears the display
setLinePos(linePos) -- Takes a single integer argument and sets the display's line position at that line
shutdown() -- Clears the display and resets the ComputerBlock

WARNING

This plugin is highly experimental

Since this plugin allows players access to native Bukkit methods ingame, there is a possibility for malicious scripts to be created and run. Methods and classes may be blacklisted in the config file, but always take precautions before allowing someone to run scripts.


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files

Bukkit