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.

 

New Video – Riding Dolphins in MC!!

I put up a new video – just a short one, showing a few commands that let you ride dolphins in MC. I hope this doesn’t offend any dolphin lovers. It’s all just for fun.

(btw: to avoid animal cruelty in MC, always use a stone or better axe when killing livestock and use a critical hit,ie jump and strike. It gives a one hit kill for cows and pigs.)

[Edit – I changed the commands a bit to make them work better together. I removed some custom names because they were causing entities to interact (stick together) in the wrong way!]

The commands are:

Summon a dolphin carrying a minecart:
execute at @p run summon minecraft:dolphin ~ ~ ~ {Passengers:[{id:"minecraft:minecart"}]}

Summon a dolphin carrying a boat (doesn’t work because you can’t ride a boat under water):
execute at @p run summon minecraft:dolphin ~ ~ ~ {Passengers:[{id:"minecraft:boat"}]}

Summon a dolphin carrying a NoAI pig (also doesn’t work because dolphins can’t take mobs as passengers – I think they pop off when the dolphin goes underwater.).
execute at @p run summon minecraft:dolphin ~ ~ ~ {CustomName:"\"Pig Bearer\"",Passengers:[{id:"minecraft:pig",NoAI:1}]}

This is one that wasn’t in the vid: use a snowball between the pig and dolphin, give the pig water breathing and a saddle. It still doesn’t work, as I recall because you can’t ride the pig under water anyway.
execute at @p run summon minecraft:dolphin ~ ~ ~ {CustomName:"\"Pig Bearer\"",Passengers:[{id:"minecraft:item",Age:-32768,PickupDelay:32767,Item:{id:"minecraft:snowball",Count:1b},Passengers:[{id:"minecraft:pig",NoAI:1,ActiveEffects:[{Id:13b,Duration:1000000,ShowParticles:0}],Saddle:1}]}]}

Summon a dolphin carrying a skeleton horse via a snowball:
execute at @p run summon minecraft:dolphin ~ ~ ~ {CustomName:"\"Bone Bearer\"",Passengers:[{id:"minecraft:item",Age:-32768,PickupDelay:32767,Item:{id:"minecraft:snowball",Count:1b},Passengers:[{id:"minecraft:skeleton_horse",NoAI:1,Tame:1,Invulnerable:1b,SaddleItem:{id:"minecraft:saddle",Count:1b}}]}]}

The following commands are for my best solution:

Summon “Clarence”, the fake dolphin:
execute at @p run summon minecraft:dolphin ~ ~ ~ {CustomName:"\"Clarence\"",NoAI:1,Invulnerable:1}

Summon the invisible dolphin with the invisible skeleton horse:
skeleton horse passenger.
execute at @p run summon minecraft:dolphin ~ ~ ~ {CustomName:"\"RideableDolphin\"",ActiveEffects:[{Id:14b,Duration:1000000,ShowParticles:0}],Passengers:[{id:"minecraft:item",Age:-32768,PickupDelay:32767,Item:{id:"minecraft:snowball",Count:1b},Passengers:[{id:"minecraft:skeleton_horse",NoAI:1,ActiveEffects:[{Id:14b,Duration:1000000,ShowParticles:0}],Tame:1,Invulnerable:1b,SaddleItem:{id:"minecraft:saddle",Count:1b}}]}]}

These are the two commands that run in a command block chain

tp Clarence to the invisible dolphin (run in repeating command block):
tp @e[name=Clarence] @e[name=RideableDolphin,limit=1]

shift Clarence a bit higher so that it looks like it is just under the player (run in chained command block):
execute at @e[name=Clarence] run execute as @e[name=Clarence] run tp ~ ~1.3 ~

I tried Pixark and Cardlife

I played Pixark for a while. It’s quite fun to play. I can’t give a very reliable review right now since I’ve only just got to the point of being ready to move out of the noob grasslands at the start of the game. The game mechanics seem to work pretty well, although I noticed that the AI in the tamed dinos is annoyingly poor and they have a lot of trouble following me. This resulted in all of them falling into a cave system at one point and needing to be rescued. I understand that Pixark is based on and very similar to Ark Survival, which I haven’t played before because I didn’t think my PC would be up to it.

I have to say the whole gritty survival thing is a little bit at odds with the plastic and playful graphics style.

I also played a new game called Cardlife by Freejam. This game is at a much earlier stage of development than Pixark, but somehow it seemed more enjoyable and immersive. I actually found it mildly addictive. I think it’s because it’s closer to Minecraft in the way resources are gathered and items such as armor are crafted. It also has quite pretty graphics. It’s based on the idea  that the entire world and the entities are made of cardboard which sounds weird but its done very well. The only  thing is that the graphics still struggle to render properly and rendering gaps are frequent, where you can see ‘through’the world. It also takes a very long time to load in areas of the world that you haven’t visited for a while. Hopefully these are just teething issues.
A couple of times I was very thankful for these issues when I  got lost while mining, and the game also couldn’t figure out where I should be and teleported me to the surface!

Both Cardlife and Pixark seem to allow almost unlimited terrain modification, but use specialized structures for building. Personally I think MC’s approach, where all structures are built from a variety of synthesized or naturally occurring blocks, is superior, even though it forces the player to place the structures on the world grid. It results in a more natural look, more customization is possible, and you don’t get those annoying moments where you are trying to place something but the game won’t let you place it where you want it to go.  It’s this balance between ease of use and flexibility that every sandbox game needs to resolve. In the future I hope to see more creativity applied to this area of game design.

Hmm. Maybe I should wait before starting a Custom Terrain playthrough

I was browsing the 1.13 changes on minecraft.gamepedia.com because quite a few of the commands have changed. I came across this:

Customized world type
  • Removed

Yikes! and I spent hours making a video on it! I saw that customised terrain wasn’t in the snapshot and I had previously just assumed they hadn’t put it in yet.

Then I read:

Planned changes

  • World generation will become data-driven, using json files, allowing for custom structures.

Whew! But this statement seems a bit vague to me. Hopefully it means there will be new functionality  to allow customised terrain again via datapack customisation.

Anyway, I’m going to hold off on doing a serious playthrough on custom terrain until this is all sorted out.

Meanwhile I’ve started working on a python program that parses function mods to enhance non-interference between mods, obfuscate tags and score variables, and allow additional text formatting with whitespace characters. Once it’s done, (if 1.13 doesn’t implement all my improvements for me!) I’ll put it online so anyone can use it.

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.

End of Term 1 update

This is just a quick update. I haven’t been active online due to focusing on getting treatment for some minor health issues (an unusual throat condition, and poor balance caused partly by my left ear abnormality), as well as doing work around the house. Also, I’ve got more engineering work coming up so I still can’t take more students. The work should be finished by June which will allow me to take on more students in the second part of the year.

I’ll leave you with a link to an article on how universities are trending toward using means other than ATAR for selecting students:

https://www.smh.com.au/education/australian-universities-admitting-56-per-cent-of-students-without-atar-20170613-gwq0yr.html

Happy New Year!!

Happy New Year! It’s exciting to be starting 2018. Lots of things have changed. I’ve moved house and I now, with my wife, own the house I’m in. (which is part of the reason I’ve been so quiet lately) I’ve also picked up some engineering work, so my availability for tutoring will be limited for the next few months. I hope this year is starting with as much promise for you as it is for me.

 

 

Tim Cook thinks learning coding is more important than ESL

http://www.theage.com.au/technology/technology-news/apple-chief-tim-cook-tells-students-learning-to-code-is-more-important-than-learning-english-as-a-second-language-20171012-gz07r5.html

Probably coding is more important than learning ESL, but I would also add that ESL is an order of magnitude harder than coding, based on my experience with overseas students.

Coding isn’t that hard with the right help. Good software practices are a bit harder! (been there, done that 😉

Fractions and Factors

Try these questions. Feel free to leave a comment if something isn’t clear. Just skip the question and go onto the next one if you can’t figure it out, but keep in mind that the questions tend to get harder.

Question 1

Calculate

Question 2

Calculate

Question 3

Cancel out the common factors to find the answer

a)

b)

Question 4

Rewrite

in the form

,

where x, y, a, b and c are integers, and 0< a < b < c < 30.

(I have a feeling this question and the next will be hard to understand. Let me know if this is the case. I could add an example to explain how to answer them.)

Question 5

Rewrite 

in the form

,

where x, y, z, a, b and n are all integers.

Question 6

Simplify

Question 7

Simplify

Question 8

Simplify

Question 9

for 

find x

Question 10

Simplify