Categories: parenting » play

RSS - Atom - Subscribe via email

Things I want to learn from Stardew Valley

| life, play, parenting

This week A+ said she wanted to play a farming game, so we went through this list of farming games on Steam and she picked Stardew Valley. I bought it for CAD 17 under her Steam account. She got pretty good at finishing her homework before playtime. After some fiddling around, we managed to figure out how to play 3-person local co-op using our old PS3 controllers.1

The first game we played used the basic farm layout and shared money. I realized that sharing all the money wasn't working out so well for me about two game weeks in because I was always reminding A+ to buy seeds before she splurged on gifts, so we started a new playthrough with separate money. A+ decided to pick the meadowlands farm layout, which meant starting with some chickens.

stardew-chicken.jpg

We now have a mayonnaise maker and four chickens. It's summer and I have a variety of crops growing. W- sometimes drops in to do some fishing or help out around the farm. We probably won't make it to the greenhouse bundle this year, but maybe next year. She'd been looking forward to getting a kitchen and trying out some of the recipes, so we saved up for it and worked together to chop down lots of trees.

Stardew Valley feels like a good rainy day activity with A+. It's a cozy place to practise making decisions and working together.

stardew-trout.jpg

A+ can get competitive and envious, which can get in the way of her having fun. Sometimes she gets envious because I've been leveling up in farming and she hasn't yet. When that happens, she becomes more motivated to help out around the farm. Sometimes it's harder for her to channel that frustration into growth. At the trout derby, she got grumpier and grumpier. First it was because W- had caught a rainbow trout and she was only catching trash. Then, when she caught a rainbow trout, she was grumpy that W- had caught a rainbow trout with a golden tag and she hadn't gotten one with a tag. "I'm never going to catch anything," she grumbled, eventually spiraling into a lump on the couch. To her credit, she kept trying for a while instead of rage-quitting, so that's progress.

I chatted with her about it the next day, when she was well-regulated. "It doesn't have to be a competition, you know," I said.

"Of course it was a competition," she said matter-of-factly. "It was the trout derby."

Apparently this competitiveness and sensitivity is pretty common and totally not out of place for a 9-year-old, especially since she's an only child. Common approaches include:

  • Stopping the game when whining starts, in the hopes that eventually the kid will learn to avoid whining: I'm not sure about this approach with A+ because I think she might benefit from some more help and support learning these skills.
  • Team sports and a structured environment: This doesn't quite feel like a good fit for us, but I'm glad it works for other people.
  • Switching to more cooperative activities: I couldn't redirect her from the trout derby because the time-limited event was too fascinating. We had to take the loss and try again another time. This, too, is a fish on the line; sometimes it escapes and there's nothing to do but to accept it and fish again.

    There's a lot we can learn together in the process of working on day-to-day things. I can put A+ in charge of most of the harvests, and she's getting better at minding the mayonnaise. I think A+ likes mining with me (I'm in charge of fighting monsters), and we can probably also chop some wood together. Maybe she'll enjoy collecting the eggs and petting the chickens now that there are more of them, especially since one of them is called Hei-hei. Then we can fish when we're in the mood for fishing, farm when we're in the mood for farming, and so on.

  • Getting used to losses by playing lots of games: Fishing is good for this. It's easy to start trying again, and there are plenty of little rewards along the way. Once we can cook, we can use meals like chowder to boost her skill.
stardew-watering.jpg

I love it when games gently help me notice ways I can grow as a person. I want to get better at focusing on processes, not outcomes.2 It's neat to see this in contrast. At the moment, A+'s attention focuses a lot on outcomes. She thinks about things like upgrading to kitchen or getting to a certain level, but it's harder for her to focus on the steps that will get her there. I notice there's stuff for me to work on, too. I struggle a little with trying to make sure I have seed money if I let A+ take care of harvesting and selling (somewhat alleviated now that I've got chickens and corn), that I can get everything watered before bedtime, that I've kept some of the produce back for bundles or quests, or that I'm making progress towards a silo before winter. I can also practice focusing on processes, not outcomes.

I know my job isn't to maximize the farm's profit. Maybe my job for now is to water the farm so that A+ can enjoy the harvest. Doesn't that sound like some kind of parenting thing I can work on learning in my bones… I know grown-ups are better at delayed gratification than kids are. I'm better at the grind. If she can enjoy a bit of the harvest and figure out if she likes it, then we can back up a little. Maybe she can water a small part of the field, and then grow from there. Maybe I can make her a little 1x1 patch with the season's fastest-growing crop, and then expand every time she gets it all the way to harvest. Tiny habits, right?

Also thinking as a grown-up, I can stagger the planting of 4-day crops like wheat so that there's always something for her to harvest.

There are other little ways we can use game mechanics to practise life skills. We can occasionally check the traveling cart for quality sprinklers, which will give us a reason to keep track of the days and save some money for opportunities. It would be great to practice this with virtual money before she needs to deal with real money.

I can also invite A+ to go mining and then use the copper to upgrade the watering cans. It's a multi-step process (copper ore, wood, coal, copper bar, upgrade), so it makes sense that I can handle that better than she can. She can focus on one step at a time and slowly get the hang of how everything comes together, just like when she was learning how to solve the Rubik's cube. It's also like the incremental independence she's growing into in other parts of her life. My job is to support her so that she can learn at the right level: not too hard, not too easy.3 Someday, after many many runs through this kind of process, she might even get the hang of creating those sequences for herself or finding people who can help her. Small steps to lifelong learning.

And when I start to get fidgety about how we play, like when she doesn't accept any of my invitations to do something (chop wood? carry water?), I can repeat: process, not outcome. It's okay for her to stand around waiting for the shop to open while I water the farm. She's excited, she's focused on the very next step towards her goal, and that's good for where she is. It's okay for things to take a while. I want to keep the process fun. The fun is the important part.

stardew-lewis.jpg

Also, there's this whole thing about taking time to talk to people, remember what they like and dislike (… or look that up in the notes), give them gifts, celebrate their birthdays, and so on. Right. There are even clear benefits for doing so. Plenty of things to get better at. =)

Stardew Valley seems like it would be great for practising these things. The general advice from the community seems to be to take it easy and not rush. Don't worry about making it to certain milestones by certain times, just have fun together. We've been playing for only a few days, but I have a feeling there's much to learn over the next few years.

Footnotes

1

PS3 controllers: On Windows, we needed DsHidMini and a powered USB hub. On Linux, we just needed the powered hub.

2

This reminds me of Atomic Habits.

View org source for this post

Having fun with words

| parenting, play

I love strewing ideas in front of A+ in case something catches her interest. A rich source of in-jokes is the word "antidisestablishmentarianism", which I introduced to her when she was… what… maybe 3? 4? and which she decided to master with her usual determination. Sometimes, when she's in a "Mom! Mom! Mom!" phase, I joke about changing my preferred name so that she has to say "Antidisestablishmentarianism! Antidisestablishmentarianism! Antidisestablishmentarianism!", which always gets either a laugh or a groan.

One of A+'s friends is a 4-year-old. She was playing the copying game with her, the one where a kid repeats everything the other person says. Whenever A+ wants to wind the game down, she confidently rattles off "antidisestablishmentarianism" and that's the end of that.

I didn't want A+ to rest on her laurels, of course. I introduced another word: paradichlorodiphenyltrichloroethane. That piqued A+'s curiosity, so I told her about DDT and I shared the limerick I learned it from.

A mosquito was heard to complain,
"A chemist has poisoned my brain!"
The source of his sorrow
was paradichloro-
diphenyltrichloroethane.

A+ got the hang of the limerick within a few days. Apparently, she's already shared it with her teacher and her nature club counselors. I think she's even been coaching the 4-year-old through saying it syllable by syllable, so perhaps there will be two of these word geeks someday.

Since A+ liked the rhythm of the limerick and she also likes math, I looked up this other fun limerick, which is attributed to Leigh Mercer:

A dozen, a gross, and a score
Plus three times the square root of four
Divided by seven
Plus five times eleven
Is nine squared and not a bit more.

Small words, but fun to play with too.

For our next steps, I want to get the hang of saying "pneumonoultramicroscopicsilicovolcanoconiosis" and "hippopotomonstrosesquippedaliophobia" (although sesquipedalophobia is the more common term).

We also pun about whatever she's interested in. At the moment, it's all red panda all the time, thanks to her enjoyment of Turning Red. ("Which animal loves books?" "A well-read panda!") We love alliteration and rhyme. We change the lyrics to her favourite songs. I had a hard time sitting down and playing with A+ when she was smaller, but now we've got so many words to play with. This is fun!

What's the use of these things? Mostly to tickle our brains and make each other smile, but also maybe the tiny chance of bumping into someone else who happens to overhear it and who chuckles out of recognition. There are people out there who like to play the kind of way we like to play, and she'll find her tribe someday.

View org source for this post

Playfulness

| parenting, play

Assumed audience: I'm writing this for:

  • me: I want to remember what this is like, celebrate my progress so far, and look ahead
  • maybe other parents who also find themselves still figuring out playfulness

Achievement unlocked: I made A+ giggle so much that she started hiccuping

She had had a case of the meh​s. After a little bit of empathizing, I flung myself over her and declared that she wasn't going anywhere, I was just going to snuggle her. It was my evil plan. I cackled a little, and then asked her for tips on proper cackling. Was it "MwahaHAha, or MwaHAhaha, or MWAhahaha?"

She said, "Meh."

I rolled with it. "Meh heh heh heh."

Ah, there, a little giggle.

I hammed it up some more. "Meh HEH heh heh heh." More and more cackling, until she was giggling continuously. She giggled so much that she started hiccuping.

"You're so funny," she said between sips of water.

That might be the only time I'll hear that from her, so I'm immortalizing it in my blog. And yes, correlation doesn't mean causation, and n=1 anyway, but I'm still going to take the win.

Play didn't come easily to me

I didn't quite know what play could look like for us, in the early days. Some parents seem to effortlessly break out silly voices or play pretend with toys. In the beginning, that felt awkward, even though I'd grown up with my dad telling captivating stories complete with sound effects and gestures. As a new parent, I often felt tired and my mind kept sliding away. It was easier to let A+ take the lead, and to focus on things like supporting and documenting. That was probably the right call for both of our personalities. From time to time, I come across parenting articles that even recommend this approach of letting the child do most of the directing. Serve and return, that's all, I just needed to keep the rhythm going; when A+ leads, I can focus on responding. I didn't even have to do it all the time; I could be a good-enough parent.

When A+ was interested in stacking blocks, I felt my job was mostly to observe and narrate appreciatively, and also to help tidy up. When she was fascinated with the water table at the Science Centre, my job was to bring dry clothes to change into. When she started building with LEGO, I helped her find pieces, but I didn't really spur her on with build ideas or roleplaying. When she moved on tea parties, I accepted my share of muddy teacups and sand cupcakes. At 9, A+ mostly likes to sing, play Minecraft, and make up stories with me. That's something I'm more comfortable with.

I'm somewhat reassured by the Slate essay Playtime Is Over!:

If you meet the child on his level and mostly watch what they’re doing instead, it’s still an act of love and attention without being such a draining experience.

I never quite felt comfortable staging those playacting dramas that would probably have helped A+ develop better social skills, like pretending one doll has accidentally bumped another one so that we could explore apologies and acceptance. I probably wouldn't have been able to get it past A+, anyway; she's pretty good at sniffing out when I'm pretending to play instead of playing pretend.

Resources

I was pretty worried in the beginning. The first six months of A+'s life were a bit of a blur, with quite a few diagnostic exams and follow-up appointments at Sick Kids Hospital. She went under general anaesthesia a couple of times, so I was extra nervous about the possible impact on her growth.1 It's hard to be playful when you're tired and anxious. Anyway, it was just what's got to be done, so we focused on figuring out how to mitigate the risks by enriching her environment. I applied to the Healthy Babies Healthy Children program, and we got approved. We regularly met with a nurse and a home visitor who helped us keep track of A+'s development, suggested relevant activities, and gave me feedback on my interactions with A+. (My notes)

I still wanted to learn more about play. We went to libraries and EarlyON child and family centres for songs, storytime, and free play. One of our favourites was the EarlyON centre at Indian Road Crescent, where Ms. Lesley was basically how I imagine Mr. Rogers or Calypso: kind, appreciative, and wise. I reach for her voice in my head when I want a model for how to talk to kids.

Thank goodness for Bluey, too, which not only demonstrated a whole trove of little games that we could play, but also helped me imagine more playful parenting with the examples of Bandit and Chilli. Bluey's totally a parenting show disguised as a kids' cartoon. A+ often suggests playing games from Bluey, like:

  • Shadowlands: walk only on shadows
  • Bandit's version of Follow the Leader: kids hide right behind leader, leader complains (from Daddy Putdown)
  • Come Here / Go Away: played on the swing, where the humour also comes from the complaints (from Daddy Putdown)

I also borrowed all the books on play that I could find, like Playful Parenting (Lawrence J. Cohen, 2008) and Play (Stuart Brown, Christopher Vaughan, 2009), because of course I'd try to learn about play from books. Might be time to reread them, come to think of it.

Figuring out our types of play

Thanks to all these different resources, I found lots of ideas to try. Experimenting helped me gradually figure out the things that resonated with both A+ and me. I liked the music classes that A+ and I went to when she was younger. We also read and read and read. I couldn't quite do the cheerful patter I sometimes heard from other parents, but songs and books helped me fill in the times when I didn't have much to say to A+. I found another little form of play to share with her, changing the words in a book or a song so that she'd laughingly correct me. She started talking at 18 months, a little on the late side of normal, but quickly expanded her vocabulary. (Also totally fine now.)

It wasn't all cerebral, of course. A+ liked the vestibular stimulation of swinging, so we spent a lot of time at the playground. She also likes climbing and hugs, so I boost her up to monkey bars and I snuggle her for as long as she likes.

A+ likes to dive deeply into her interests, and I like to go along with her. Over the years, I've learned a lot about sharks, Rubik's cubes, Star Wars, and Minecraft. That's our kind of play, too. We have some running jokes now. For example, on learning that nurse sharks might possibly trick fish into a false shelter and then ambush them,2 we had fun imagining a nurse shark holding a "Definitely not a trap" sign. This sketch doesn't quite have the shark pointing upwards, but it was fun anyhow.

I'm learning a lot about play from life with A+. I'm learning that it can look different from person to person. I tend to have a quieter type of play, and that's okay. Also, if I don't feel like playing a particular way, it's good to say so. We can usually figure out something else, or I can figure out what I need and then check in again when I'm ready.

I'm upfront about still figuring all of this out. I think it's good for her to see that. Sure, it would make more sense for fun to be natural and effortless, but this is the kind of person I am, so I've got to work with what I've got–and that's enjoyable too, in its own way.

One of the things that's been helping me is seeing A+ also learn about and accept her own play preferences. At the playground, A+ often takes a break when her friends play a shrieky sort of game like tag. She knows she doesn't like those kinds of games, and she can find other things to do until her friends move on. She usually comes and hangs out with me instead. Sometimes we go play one of our own games. Then she heads back to check in with her friends, and they all go off to play something else.

It's fun watching A+ figure things out. When she had a hard time settling down at bedtime the other night, she suggested taking turns reading a book. I agreed, of course. I'll always say yes when she offers to read out loud, and reading out loud lets me play our old game of changing things up. "I knew you'd say yes to that," she crowed. She's learning to offer games we both like.

We're both learning about ourselves through play. Reading about play personalities, I think: ah, my dad was a joker, even towards the end of his life; one time he stashed an ice cube under his tongue to prank the nurse who came in to check his temperature. My sister's a bit of one too with her witty rejoinders. A+ might be a storyteller considering her fascination with story variations. I might be a creator, considering my list of crafty hobbies and the fun I have tweaking Emacs. Play is fun, and fun is great for self-knowledge.

Some things that seem to be working for us for now

Physical play: Pretty good way to get her out of a grump. I can challenge her to tackle-hug me: she'll try her best to push me over and collapse on me with a hug, then I'll try my best to wrap her up and prevent her from escaping. I can carry her on my back and whirl around. I can lift her up to the chin-up bar.

Clapping games: We can play Double Double This This or Slide pretty much anywhere.

Bubbles: We like bubbles. We even make our own giant bubble mix following the guar gum recipe on the Soap Bubble wiki. We've decided not to bring giant bubbles to the park when there are lots of kids around, though, because then we tend to get swarmed by other kids and it's a little stressful for A+. It's something to enjoy at small playdates.

Wordplay: It's fun to come up with puns and variations on songs. She's getting pretty good at it too.

Drawing: Silly faces are fun and easy to make. Pictionary is also good.

Singing: Good way to get in sync. We like to sing songs from Disney movies and from Wicked. There's a fair bit of research about maternal singing3, and entrainment4 might have prosocial effects even for older kids. Besides, music is fun, and we can do it pretty much anywhere.

Robot: Lots of chores get done by the Chore-Bot 9.0. A+ is amused whenever I'm a hug-bot. She also likes it when I'm a scientist or engineer investigating the functions of this mysterious device that seems to be powered by hugs.

Minecraft: Inside, we play in Bedrock if I've got the patience to reboot out of Linux and into Windows, or Java if we want to play in the world we share with W+. A+ likes to start up new worlds to try out different ideas or add-ons, so I'm slowly learning how to be less attached to any particular world.

Our shared Minecraft experiences even help us pass the time at the playground. We often play pretend Minecraft. I don't mind being the odd grown-up who's pretending to mine for iron or run away from skeletons. I think A+ enjoys rescuing me from the predicaments I make up for myself. ("Oh no, there's an Enderman! Aah! Don't look at it!" "Here's a pumpkin I carved!")

Stories: A+ loves making up stories related to Disney or Star Wars characters. Sometimes we use the fortunately/unfortunately structure to improvise a story, and sometimes we just pile things on. When I'm tired, it's hard for me to imagine enough to improvise, but I'm glad that I can explore some of her "what if" questions with ideas translated from fanfic. She also does a bit of LLM-prompting of story ideas, and she includes those in some of our bedtime improvisation as well.

Looking ahead

I've got maybe a year or two of A+ wanting to play with us before she focuses on playing with other people. I'll take that however it looks: screen time when that's what she feels like, park time whenever we can. I'm not terribly worried about screentime. I know that it can take a while to get her outside, but then she wants to stay at the park for as long as possible. It's easier to get her outside when we have playdates, which we schedule fairly regularly. When it's just me, we go with the flow.

Here's what I'm keeping an eye out for to help me get better at playing with A+:

  • Managing my own patience: It's a lot easier to play when I'm well-rested, I'm not fretting, and I don't have an unfinished task hogging my brainspace.5
  • Seeing the invitation properly: "Can we play together?" means "I want to connect with you." So does "I'm bored bored bored bored bored."
  • Building our play vocabulary: Bluey is totally research, yeah, that's why I'm watching it. There's also paying attention to the little things that A+ and I are curious about or enjoy. The more things we try, the more ideas we can combine.

It's child's play, and that's why it's worth it.

Footnotes

2

Food and Agriculture Organization of the United Nations:

Young nurse sharks have been observed resting with their snouts pointed upward and their bodies supported off the bottom on their pectoral fins; this has been interpreted as possibly providing a false shelter for crabs and small fishes that the shark then ambushes and eats.

3

Here's one example: Markova, G., Nguyen, T., Schätz, C. and De Eccher, M. (2020). Singing in Tune – Being in Tune: Relationship Between Maternal Playful Singing and Interpersonal Synchrony. Enfance, 1(1), 89-107. https://doi.org/10.3917/enf2.201.0089.

Results showed that 38 dyads spontaneously engaged in social game routines. In these dyads, both playful singing and rhyming were positively associated with dyadic gaze synchrony, while only playful singing was also positively correlated with affect synchrony of the dyad. These findings suggest that rhythms, in general, may have important implications for the establishment of interpersonal synchrony in infant-caregiver dyads. However, musical rhythms seem to be particularly emotionally-salient and thus attune both interactional partners to the affective content of their social exchanges.

4

Interpersonal Entrainment in Music Performance | Music Perception | University of California Press

A variety of studies have revealed that synchronized movement, both musical and otherwise, can affect attitudes and cooperative behaviors toward one’s co-actors.

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

Minetest and MineClone 2

| fun, geek, play

A number of A+'s friends play Minecraft, so she got curious about it and started reading lots of e-books. We figured it might be time to let the video game genie out of the bottle since she tends to dive deeply into new interests and learn a lot. I wanted to get her started on Minetest, though, instead of buying one of the Minecraft editions. (Yay free and open source software!)

I installed MineTest, then used the Content tab to install MineClone 2 and the tutorial. I updated the other X220 so that I could run it there too, and we eventually turned it into a server. I went through the tutorial and then I showed it to her. We drew up an agreement to treat it the same as video time (20-minute timers for eye breaks, daily limits, need to be in the green zone). W- connected the other X220 to the TV with a VGA cable, and I used a USB hub to connect two keyboards and two mice to the laptop. A+ completed part of the tutorial. She found it hard to work the keyboard and the mouse while looking at the screen. She liked giving me directions to follow, taking over clicking or crafting whenever she felt comfortable.

We've been playing MineClone for almost a week, and it's starting to feel comfortable. We have a little base with a wheat/carrot farm, a well, and a fishing pond, and we're exploring the world. We might try creative mode in a while.

It looks like A+'s mostly curious about mobs, farming, ores, and flying around. She loves noticing things to explore and new recipes to craft. W- sometimes joins us, which is extra fun and helpful.

Minetest gives me opportunities to learn useful things, too. I'm getting better at saying yes to A+ when she wants to craft something, even if I wanted to save the materials for something else. (I should make a MineClone version of the reminder in our kitchen that says "Groceries are tuition for raising a cook.")

I'm still too impatient for the regular process of navigating around and bumping into resources, especially since we're working within 20-minute segments. I flew around with noclip/fast and set up some Travelnet boxes near interesting things, which A+ has liked a lot because now she can teleport independently.

I'm way too chicken to deal with damage, hostile mobs, or even night time at the moment. Since A+ would really like me to go fight the mobs she loves to read about, I'm thinking about how to gradually build up my courage with some kind of exposure therapy. =) I started learning how to modify armor so that I can keep myself mostly protected while leaving damage enabled for anyone who's braver (like W-). Maybe as I get the hang of it, I'll be able to dial down the protection or just let it keep a minimum HP level.

Lots of learning ahead!

Making a menu of activities

| sketchnotes, drawing, parenting, play

A- wants to be with me almost all the time. This can be challenging.

A multiple-choice question is easier than a fill-in-the-blank one, especially when it comes to "What do we do now?" A- seems less grumpy throughout the day when she can go from one activity to another of her choosing. I like letting her take the lead. I also like not having to come up with stuff. During bedtime, I sketched this menu: