PPHPloom
Workflows

Minecraft Datapack Steps With an Agent

03
Worked example

A welcome kit for new players

A datapack is a good first project. A new player runs one function and receives a few items and a title. Here is how a change travels from your request to a test in your world, with PHPloom editing the files and you deciding at 4 clear points.

01

Open the pack folder

Choose your datapack folder as the working folder in PHPloom and pick Ask first.

02

Describe the kit

Write the task in plain words, for example a kit with bread, a sword and a title.

03

Review the diff

Read every proposed line, accept the ones you want and reject the rest.

04

Reload and test

In your own world, type /reload, run /function welcome:kit and check each item.

The function file it writes

data/welcome/function/kit.mcfunction
# data/welcome/function/kit.mcfunction
# Run as a player: /function welcome:kit
say A new player joined the world.
give @s minecraft:bread 8
give @s minecraft:stone_sword 1
give @s minecraft:torch 16
effect give @s minecraft:resistance 30 0 true
title @s title {"text":"Welcome","color":"gold"}
tellraw @s {"text":"Kit received. Have fun!"}

Each line is one command. The give lines hand out items, effect give adds a 30 second resistance effect, title shows a big heading, and tellraw sends a chat message to the player who ran the function.

How to make a modded Minecraft server: two datapack helpers

Summon an invisible armor stand with one command

A server owner wants an invisible armor stand at the spawn point, without a repeating command that keeps giving it invisibility. PHPloom writes one summon line into a function file, with the data tag Invisible:1b set inside the entity data, so the stand is invisible from the start. It reads the pack back with read_file and uses grep to confirm that only 1 summon line exists. You review the diff, type /reload and run the function once in your own world to check the result.

A command for counting mobs on your test server

To count mobs, PHPloom writes a function with an execute store result score line that ends in if entity and a selector for one mob type, for example zombies. The count lands in a score holder named Zombies, which you can show on the sidebar with the scoreboard objectives setdisplay command. The agent uses write_file for the function and read_file to check it. Ask first lets you read both lines before they exist. In your own world, spawn 3 zombies, run the function and compare the sidebar number with what you see.

PHPloom for Windows

Try the steps on your own world

Download PHPloom ↗