Categories: minecraft

RSS - Atom - Subscribe via email

Minecraft tree orbs, tree farm upgrade

| minecraft

A+ was inspired by the SapWing villages from Wings of Fire to make a couple of orb houses up in the trees.

2025-01-16_17.33.21.png
Figure 1: A+'s latest creation: tree orbs

I think she used copycat blocks and vertical slabs from the modpack in order to get it to look so round. "I'm excellent at creating things that are not supposed to exist in Minecraft, in Minecraft," she says. The rope ladder is from me, as I needed a non-creative-mode way to get up there.

2025-01-16_18.01.13.png
Figure 2: A bridge connects the two tree orbs. A+ is a big fan of safety railings.
2025-01-16_18.02.05.png
Figure 3: My orb has a hammock, a furnace, and a crafting table
2025-01-16_18.29.08.png
Figure 4: She also decided to upgrade my tree farm with rich soil, a portable storage interface, and an item sorter.

The smart chute is set to drop only full stacks (64 items) so that the extra saplings will stay in the chest and feed the deployer. The brass funnels have the different items in their filter slots. She has them feeding into netherite backpacks.

2025-01-16_17.36.34.png
Figure 5: As for me, I made a simple library with an enchanting table.

I've got a couple of librarians. I'll probably set up some more eventually, maybe in a large wing focused on trading. I've also been upgrading the wheat farm with organic compost that's broken down into rich soil. I started some flax plants for string.

Just toodling along…

View org source for this post

A brief foray into Underdog, a realistic Minecraft modpack; returning to Total Animation

| minecraft

A+ often enjoys watching Minecraft videos on Youtube where streamers take on challenges like surviving harder, more realistic worlds. We briefly gave RL Craft a spin the other day, but I died to a dragon and that wasn't realistic enough for A+, so we checked out Underdog today.

We couldn't get Underdog to work under GDLauncher on her computer even when I changed the Java interpreter and memory settings as suggested in the Underdog installation instructions. I installed PrismLauncher on her computer and that worked fine.

As usual, when we started the world, we set it to peaceful and turned the day/night cycle off. The early progression quests went all right, except for the one about obtaining 32 balls of clay. We found a few, but I'm not sure if there were enough clay blocks near our spawn or maybe they were just hard to see under the water. I liked how the process of making charcoal involved making a pit and burning the stacked firewood blocks under a nonflammable material (I used dirt).

2025-01-02_12.27.05.png
Figure 1: Our little crafting area in Underdog.
2025-01-02_12.27.10.png
Figure 2: Making some charcoal by burying burning wood under dirt

A+ wasn't a fan of how much work was involved in everything, though, so I'm not sure we'll return to this world. I think when she says "realistic", she's looking for something more like Total Animation than TerraFirmaCraft. Here's what Total Animation looks like:

2025-01-02_14.17.33.png
Figure 3: Screenshot of Total Animation

(You can tell I built the house because it's a boring box-like thing made with whatever wood was handy.)

We last checked out Total Animation in October. It's a little too laggy on my Lenovo P52 laptop, so I usually play without the shaders and visual effects that make it special. A+ has more patience for that, and since she plays in Windows, her P52's (small) Nvidia GPU can accelerate it enough to be tolerable.

There are a ton of modpacks that focus on more realistic textures/shaders/etc., so she'll probably flip through a few of them. I might as well practise my journaling along the way.

View org source for this post

Cuberventures: Early game Create Mod

| minecraft

A+ likes exploring different Minecraft Java modpacks in creative mode. We're currently playing FXNT Create 2. I like challenging myself to figure things out in survival mode, so I'm getting a lot of practice in building early-game survival farms with Create. My setup has changed a little bit over the last few modpacks/worlds. I usually start by mining enough iron and zinc to make a mechanical press so that I can make the iron sheets used in other machines. Then I make a mechanical mixer so that I can make andesite nuggets more efficiently. Then I make a millstone and an encased fan so that I can process cobblestone and wash the resulting gravel manually.

Once that's in place, I can start making more elaborate things.

2025-01-01_16.47.59.png
Figure 1: A simple radial tree farm uses a mechanical saw.
2025-01-01_16.47.03.png
Figure 2: This time, I experimented with putting my crop farm under the tree farm.

I used to have the encased fans just blowing horizontally. After I learned that I can use encased fans to blow upwards through a depot, I switched to setting up my blasting/smoking/washing stations vertically so that I didn't burn myself as often.

2025-01-01_16.36.12.png
Figure 3: My blasting/smoking/washing stations

The most recent thing I added to this world is this cobblestone-gravel-iron nugget machine.

2025-01-01_13.27.19.png
Figure 4: The cobblestone generator…
2025-01-01_13.28.06.png
Figure 5: … feeds into a millstone/washer
2025-01-01_13.29.02.png
Figure 6: All together now
2025-01-01_16.07.40.png
Figure 7: I changed the cobblestone output to feed into two millstones, dropping the results with chutes

I needed to upgrade to a large waterwheel to drive the two millstones along with the fans.

Next things I'll probably try:

  • The lava farm is filling up nicely, so I can put some pipes underneath it and have a pump move lava into a basin for making andesite. That'll give me something to do with the flint from the iron nugget farm. I'll need to mine some copper first, though.
  • I can start mining for diamonds so that I can get obsidian and go to the Nether. I made a rope pulley + drills mining contraption, but (a) I think it got stuck after going past some lava and water, and (b) the shaft it made uncovered a deep dark biome, so… that's a little scary. Maybe I'll do some branch mining, or cave mining when the world is set to peaceful.
View org source for this post

Updating my Minecraft command book using Emacs, TRAMP, and mcf.el

| minecraft, play, emacs

I wanted to see what else people have done in terms of combining Minecraft and Emacs. It turns out that you can control Minecraft from Emacs via mcf if you set enable-rcon=true in your server.properties (also a good idea to set rcon.password) and you configure variables like mcf-rcon-password on the Emacs side. It needed a little tweaking to get it to connect to a remote server, so I've submitted a pull request. Anyway, since Emacs can talk to Minecraft and I can write sequences of Minecraft commands as functions, I thought about turning my Minecraft command books into something that I could update right from Emacs.

Creating my own datapack was pretty straightforward once I figured out the directory structure. I needed to put functions in <world-name>/datapacks/sachac/data/sachac/functions. Inside <world-name>/datapacks/sachac, I created pack.mcmeta with the following contents:

{
    "pack": {
        "pack_format": 10,
        "description": "sachac's tweaks"
    }
}

Inside <world-name>/datapacks/sachac/data/sachac/functions, I created a command_book.mcfunction file with the command to give me the book. I updated my command book function to remove the / from the beginning.

I used /reload to reload my Minecraft configuration and /datapack list to confirm that my datapack was loaded. Then /function sachac:command_book ran the function to give me the command book, so that all worked out. I replaced the command in the command block with the function call.

The next step was to update it directly from Emacs, including reloading. First, I needed a function to give me the filename of a function file.

(defun my-minecraft-datapack-function-file-name (world datapack-name function-name)
  "Return the filename for a mcfunction file given WORLD, DATAPACK-NAME, and FUNCTION-NAME."
  (seq-reduce
   (lambda (path subdir) (expand-file-name subdir path))
   (list "datapacks"
         datapack-name
         "data"
         datapack-name
         "functions"
         (concat function-name ".mcfunction"))
   world))

I used C-c C-x p (org-set-property) to add a WORLD property to my Org subtree. For example, my snapshot world is at /ssh:desktop:~/.minecraft/saves/Snapshot. Then I can get the correct value within the subtree by using org-entry-get-with-inheritance. This is how I wrote the command book function for my snapshot world:

#+begin_src emacs-lisp :var body=mc-snapshot :var team=mc-team :var quick=mc-quick :var effects=mc-effects :var items=mc-items :results silent
(with-temp-file
    (my-minecraft-datapack-function-file-name
     (org-entry-get-with-inheritance "WORLD")
     "sachac"
     "command_book")
  (insert (my-minecraft-book "Commands 8.5" "Mom" (append team quick body effects items))))
(mcf-eval "reload")
#+end_src

So now I can use C-c C-c to execute the Emacs Lisp block and have my Minecraft world updated. Then I just need to right-click on my command block's button or run the function in order to get the new version.

I'm looking forward to learning more about mcfunctions so that I can write a function that automatically replaces the book in everyone's inventories. Could be fun.

Using Org Mode tables and Emacs Lisp to create Minecraft Java JSON command books

| minecraft, org, emacs, play
  • [2023-04-12 Wed]: Remove / from the beginning so that I can use this in a function. Split book function into JSON and command. Updated effects to hide particles.
  • [2023-04-10 Mon]: Separated trident into channeling and riptide.

A+ likes playing recent Minecraft snapshots because of the new features. The modding systems haven't been updated for the snaphots yet, so we couldn't use mods like JourneyMap to teleport around. I didn't want to be the keeper of coordinates and be in charge of teleporting people to various places.

It turns out that you can make clickable books using JSON. I used the Minecraft book editor to make a prototype book and figure out the syntax. Then I used a command block to give it to myself in order to work around the length limits on commands in chat. A+ loved being able to carry around a book that could teleport her to either of us or to specified places, change the time of day, clear the weather, and change game mode. That also meant that I no longer had to type all the commands to give her water breathing, night vision, or slow falling, or give her whatever tools she forgot to pack before she headed out. It was so handy, W- and I got our own copies too.

Manually creating the clickable targets was annoying, especially since we wanted the book to have slightly different content depending on the instance we were in. I wanted to be able to specify the contents using Org Mode tables and generate the JSON for the book using Emacs.

Here's a screenshot:

2023-04-09_10-09-48.png
Figure 1: Screenshot of command book

This is the code to make it:

(defun my-minecraft-remove-markup (s)
  (if (string-match "^[=~]\\(.+?\\)[=~]$" s)
      (match-string 1 s)
    s))

(defun my-minecraft-book-json (title author book)
  "Generate the JSON for TITLE AUTHOR BOOK.
BOOK should be a list of lists of the form (text click-command color)."
  (json-encode
   `((pages . 
            ,(apply 'vector
                    (mapcar
                     (lambda (page)
                       (json-encode
                        (apply 'vector 
                               (seq-mapcat
                                (lambda (command)
                                  (let ((text (my-minecraft-remove-markup (or (elt command 0) "")))
                                        (click (my-minecraft-remove-markup (or (elt command 1) "")))
                                        (color (or (elt command 2) "")))
                                    (unless (or (string-match "^<.*>$" text)
                                                (string-match "^<.*>$" click)
                                                (string-match "^<.*>$" color))
                                      (list
                                       (append
                                        (list (cons 'text text))
                                        (unless (string= click "")
                                          `((clickEvent 
                                             (action . "run_command")
                                             (value . ,(concat "/" click)))))                                    
                                        (unless (string= color "")
                                          (list (cons 'color
                                                      color))))
                                       (if (string= color "")
                                           '((text . "\n"))
                                         '((text . "\n")
                                           (color . "reset")))))))
                                page))))
                     (seq-partition book 14)
                     )))
     (author . ,author)
     (title . ,title))))

(defun my-minecraft-book (title author book)
  "Generate a command to put into a command block in order to get a book.
Label it with TITLE and AUTHOR.
BOOK should be a list of lists of the form (text click-command color).
Copy the command text to the kill ring for pasting into a command block."
  (let ((s (concat "item replace entity @p weapon.mainhand with written_book"
                   (my-minecraft-book-json title author book))))
    (kill-new s)
    s))

With this code, I can generate a simple book like this:

(my-minecraft-book "Simple book" "sachac"
                   '(("Daytime" "set time 0800")
                     ("Creative" "gamemode creative" "#0000cd")))
item replace entity @p weapon.mainhand with written_book{"pages":["[{\"text\":\"Daytime\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/set time 0800\"}},{\"text\":\"\\n\"},{\"text\":\"Creative\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/gamemode creative\"},\"color\":\"#0000cd\"},{\"text\":\"\\n\",\"color\":\"reset\"}]"],"author":"sachac","title":"Simple book"}

To place it in the world:

  1. I changed my server.properties to set enable-command-block=true.
  2. In the game, I used /gamemode creative to switch to creative mode.
  3. I used /give @p minecraft:command_block to give myself a command block.
  4. I right-clicked an empty place to set the block there.
  5. I right-clicked on the command block and pasted in the command.
  6. I added a button.

Then I clicked on the button and it replaced whatever I was holding with the book. I used item replace instead of give so that it's easy to replace old versions.

On the Org Mode side, it's much nicer to specify commands in a named table. For example, if I name the following table with #+name: mc-quick, I can refer to it with :var quick=mc-quick in the Emacs Lisp source block. (You can check the Org source for this post if that makes it easier to understand.)

Daytime time set 0800  
Clear weather weather clear  
Creative gamemode creative #0000cd
Survival gamemode survival #ff4500
Spectator gamemode spectator #228b22
(my-minecraft-book "Book from table" "sachac" quick)
item replace entity @p weapon.mainhand with written_book{"pages":["[{\"text\":\"Daytime\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/time set 0800\"}},{\"text\":\"\\n\"},{\"text\":\"Clear weather\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/weather clear\"}},{\"text\":\"\\n\"},{\"text\":\"Creative\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/gamemode creative\"},\"color\":\"#0000cd\"},{\"text\":\"\\n\",\"color\":\"reset\"},{\"text\":\"Survival\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/gamemode survival\"},\"color\":\"#ff4500\"},{\"text\":\"\\n\",\"color\":\"reset\"},{\"text\":\"Spectator\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/gamemode spectator\"},\"color\":\"#228b22\"},{\"text\":\"\\n\",\"color\":\"reset\"}]"],"author":"sachac","title":"Book from table"}

Then I can define several named tables and append them together. Here's one for different effects:

Water breathing effect give @p minecraft:water_breathing infinite 255 true  
Night vision effect give @p minecraft:night_vision infinite 255 true  
Regeneration effect give @p minecraft:regeneration infinite 255 true  
Haste effect give @p minecraft:haste infinite 2 true  
Health boost effect give @p minecraft:health_boost infinite 255 true  
Slow falling effect give @p minecraft:slow_falling infinite 255 true  
Fire resist effect give @p minecraft:fire_resistance infinite 255 true  
Resistance effect give @p minecraft:resistance infinite 255 true  
Clear effects effect clear @p  

Some commands are pretty long. Specifying a width like <20> in the first row lets me use C-c TAB to toggle width.

Pickaxe give @p minecraft:diamond_pickaxe{Enchantments:[{id:"minecraft:fortune",lvl:4s},{id:"minecraft:mending",lvl:1s},{id:"minecraft:efficiency",lvl:4s}]}  
Silk touch pickaxe give @p minecraft:diamond_pickaxe{Enchantments:[{id:"minecraft:silk_touch",lvl:1s},{id:"minecraft:mending",lvl:1s}]}  
Sword give @p minecraft:diamond_sword{Enchantments:[{id:"minecraft:looting",lvl:4s},{id:"minecraft:mending",lvl:1s}]}  
Axe give @p minecraft:diamond_axe{Enchantments:[{id:"minecraft:looting",lvl:4s},{id:"minecraft:mending",lvl:1s}]}  
Shovel give @p minecraft:diamond_shovel{Enchantments:[{id:"minecraft:fortune",lvl:4s},{id:"minecraft:mending",lvl:1s},{id:"minecraft:efficiency",lvl:4s}]}  
Bow give @p minecraft:bow{Enchantments:[{id:"minecraft:infinity",lvl:1s},{id:"minecraft:mending",lvl:1s}]}  
Arrows give @p minecraft:arrow 64  
Torches give @p minecraft:torch 64  
Fishing give @p minecraft:fishing_rod{Enchantments:[{id:"minecraft:lure",lvl:4s},{id:"minecraft:luck_of_the_sea",lvl:4s},{id:"minecraft:mending",lvl:1s}]}  
Riptide trident give @p minecraft:trident{Enchantments:[{id:"minecraft:loyalty",lvl:4s},{id:"minecraft:mending",lvl:1s},{id:"minecraft:riptide",lvl:4s}]}  
Channeling trident give @p minecraft:trident{Enchantments:[{id:"minecraft:loyalty",lvl:4s},{id:"minecraft:mending",lvl:1s},{id:"minecraft:channeling",lvl:1s}]}  
Weather rain weather rain  
Weather thunder weather thunder  
Birch signs give @p minecraft:birch_sign 16  
Bucket of water give @p minecraft:water_bucket  
Bucket of milk give @p minecraft:milk_bucket  
Bucket of lava give @p minecraft:lava_bucket  
Water bottles give @p minecraft:potion{Potion:"minecraft:water"} 3  
Blaze powder give @p minecraft:blaze_powder 16  
Brewing stand give @p minecraft:brewing_stand  
Magma cream give @p minecraft:magma_cream  

Here's what that table looks like in Org Mode:

2023-04-10_09-55-57.png
Figure 2: With column width

Here's how to combine multiple tables:

#+begin_src emacs-lisp :results silent :var quick=mc-quick :var effects=mc-effects :var items=mc-items :exports code
(my-minecraft-book "Book from multiple tables" "sachac" (append quick effects items))
#+end_src

Now producing instance-specific books is just a matter of including the sections I want, like a table that has coordinates for different bases in that particular instance.

I thought about making an Org link type for click commands and some way of exporting that will convert to JSON and keep the whitespace. That way, I might be able to write longer notes and export them to Minecraft book JSON for in-game references, such as notes on villager blocks or potion ingredients. The table + Emacs Lisp approach is already quite useful for quick shortcuts, though, and it was easy to write. We'll see if we need more fanciness!

View org source for this post