Jaffle Minecraft modding platform

I’ve finally got my modding platform for command mods in MC working. It’s now available on github as a download.  I have released it under the MIT License so be sure to copy the copyright information and license if you use any part of the code in your own project. If you put your own project in a separate datapack, you won’t need to include any of the original license information in it.

How it works

The basic concept is pretty simple. Jaffle creates an armor stand with a scoreboard variable that increments every clock tick and resets every second. A specific function in each mod is called within each clock tick in a one second period. A function in each mod is also called every single clock tick. This allows mods to execute every second or every clock tick and also reduces performance penalty by spreading the processing load across a one second interval.

To clarify the terminology used for Jaffle, a ‘mod’ can refer to either a set of functions in a single namespace, ie a module, or it can refer to the conceptual mod composed of functions which change the way MC works. Normally all the function files for a single mod will be kept in the same functions folder within the namespace for that mod.

Jaffle can be configured with all the mods in the same datapack as Jaffle itself, however if you put the mods in a separate datapack it means you won’t need the original license file in your datapack.

The platform uses ‘glue’ modules which have their own namespace. These are named jaf_modX, where X is the mod number. The platform currently allows up to 10, but you can probably figure out how to change Jaffle to allow even more mods.

The glue modules then call the relevant functions in your own modules. That way the original Jaffle functions don’t need to be changed. The developer just needs to add their own glue module and mod functions. You can mix and match different mods together. It’s also ok to change the mod number in the glue module for compatibility.

A module called jaf_pack contains a couple of functions used by Jaffle to display an introduction to the mod pack when the pack is first started up in the MC world. These functions should be updated by the developer.

There are a couple of example modules included with Jaffle: joa_fx and joa_pim. joa_fx just provides an effect that causes any entity with the JOA_FX_Num scoreboard variable set to 1 to spin around, give off colorful particles and rise up in the air for a couple of seconds. joa_pim protects valuable items by preventing them from despawning and making them invulnerable to damage. It also stops items from falling into the void.

These modules show how Jaffle can be used to simplify command mod development in MC.

There is a python script, manual_parser.py, in the Jaffle datapack folder (called jaffle-master in the direct download). This can be used to generate a release version of the mod pack (more on this in a later post) or can be used to check if there are repeated tags or scoreboard variables between modules. The developer needs to maintain a list of their scoreboard variables and tags to make use of this, hence the name ‘manual’_parser. I’m working on an automatic parser that will one day automatically identify tags and scoreboard variables, even when inside quotes.

How To Use it

Due to the way Github works, the downloaded zip file can’t be placed directly in the datapacks folder of the world. Instead, extract the jaffle-master folder and place that folder in the datapacks folder.

Be aware that this folder will disappear if your MC world is deleted, therefore I strongly recommend backing up your design to a more permanent location. Github is a good idea if you understand or can learn how to use Git and don’t mind paying the monthly fee or having your backup publicly visible. It allows copies to very quickly be dropped into your MC worlds.

To create a new mod pack, just replace the contents of the files in the jaf_pack namespace to display the information you wish to be displayed.

To create a new mod, create your own namespace and put your files in them, keeping in mind that some will be called just once, others once per second and others every clock tick.

create the jaf_modX namespace, replacing X with the next available single digit number. Jaffle will try to call specific functions within this namespace. These include setup, tick0 … tick19, everytick and intro. These files should call the relevant files in your mod. You could just put your code in there, but then your mod wouldn’t have its own namespace.

Use the example modules in the Jaffle download to understand how the mod platform should be configured.

 

Has it been that long??

Did I really not post to this site since last August??

I guess I have been busy, what with:

  • Moving house
  • Some contract work that came up earlier this year
  • Dealing with some minor but troublesome health conditions
  • Working on the new house.

Anyway that’s mostly over. I have more contract work coming so I might be too busy soon, so I’d better post now before it gets too busy again.

I really wanted to post some video of me playing MC with my command pack and a custom preset, but couldn’t get around to it due to the above and because one of my health problems is a throat condition that made it hard to talk for long periods. I still want to do that though, but I also want to make sure my custom preset doesn’t prevent the new aquatic biomes from appearing.

I have, however, just purchased PixArk, available now on Steam. I’m looking forward to trying it out. It should be fun, especially multiplayer with another player.

Item Sorter Structure, updated for MC 1.12!

I’ve finally been able to update my item sorter structure for MC 1.12 and load it onto the Minestruck server. (minestruck.site11.com) The link is here:

http://minestruck.site11.com/view.php?id=88

Honestly  there’s not much particularly fun about this sorter structure. It’s meant to be used in custom maps out of sight of the player. Items go into the hopper at the top and come out the bottom in one of two chests depending on whether the item is the selected item (diamond by default). Signs on the structure let the user know how to use/customise it.

Make sure it is turned on before using, otherwise it might get clogged up inside.

I tried to make it efficient by adding commands that switch it off automatically when not in use.

Originally I made this structure for MC 1.11, but the command syntax has changed a bit since then (quotes are required for item names and list entry syntax requirements have also changed slightly)

Here’s an earlier demo video:

My first mod – Highway Maker

I have just (re)published my first mod on this website. (I published it previously when my website was hosted by Godaddy using their horrible Website Builder service. Now I’m used to WordPress I won’t be looking back!)

The mod is called Highway Maker. It allows the player to put high speed highways in their Minecraft world while playing a survival game. Unfortunately it only runs on MC 1.11, because I finished it quite some time ago and got distracted when MC 1.12 came out with functions.

Here is the link to the page.

Mods to come

I’ve just put together this site so I haven’t had time to publish the mods and structures I’ve done which are:

  1. an older mod for MC 1.11 which is my first mod. It lets you put down high speed highways in your MC world. It’s a bit clunky but works well enough.
  2. a sorter structure using command blocks. It separates out one specific item from other items in a chest. I think it’s broken in MC 1.12 but I might have fixed it. I can’t remember at the moment!
  3. a mod that protects valuable items in the game, that I originally put in a structure file as a set of command blocks and later put in a function pack.
  4. A mod that I combined with the valuable items protector, in a function pack which makes the player transition between three stages after death – ghost, glass body and real body. This is to give the player a little more motivation to stay alive even though their valuable items will be protected.