Hello world
Your first script, how blocks snap together, and how a script starts and ends.
Open the editor
Join your server and type /editor. You get a link in chat that opens the editor already signed in as you.
A project in Denovo is called a denovo. Press save at the top and give yours a name, and you are ready to
go.
Your first script
Drag when a player joins out of the Events section, then drop send the message from Actions underneath it. They snap together.
Read it out loud and it says what it does: when a player joins, send the player the message "Hello world!".
The green player on the event block is an event value: the player who just joined. Drag it out of the event
block and drop it into the first slot of send the message. Every event has its own values, for example
when a block is broken gives you the player who broke it and the block that broke. The
Events definitions list all of them.
How blocks fit together
Blocks come in four shapes, and the shape tells you where a block can go.
| Shape | What it does | Example |
|---|---|---|
| Flat top, tab underneath | An event. It starts a script and says when it runs. | when a player joins |
| Notch on top, tab underneath | A statement. It does one thing, then the next block runs. | send the message |
| Opens around other blocks | A C block. It runs the blocks inside it, once, many times or not at all. | if, repeat |
| Small, no notch | A value. It sits inside a slot of another block and gives it something. | name of player |
A stack runs from top to bottom, one block after the other:
The player sees "Hello world!", gets three cookies, then sees "Have some cookies.". Swap two blocks and they happen in the other order.
Taking your time
All of that happens in the same instant. To spread blocks out over time, put a wait block between them. Time in Minecraft is counted in ticks, and 20 ticks are one second.
While a script waits, the rest of the server carries on as usual.
How a script starts
A script always starts with an event block. Nothing can snap above it, because nothing comes before the moment it describes. You can have as many scripts as you like in one project, each with its own event.
Here is one that starts with a command instead. when the command /hello is run has a slot for the command name, and the command works as soon as the script is switched on:
join text glues pieces of text together, so a player called Steve sees "Hello, Steve!".
How a script ends
A script ends after its last block. There is nothing to add at the bottom.
To stop earlier, use return. Everything below it is skipped:
if is a C block: the blocks inside it only run when its condition is true. A sneaking player gets the secret message, and return ends the script right there, so they never see the normal greeting.
Blocks without an event never run
A stack that has no event block on top is left alone. In script mode it shows up as detached { }. If a whole
project has no event block, the server says so in its log.
Run it
Let it save
Once your denovo has a name, the editor saves it by itself a moment after every change. The name at the top shows saving… and then saved.
Switch it on
In game, type /denovos and click the book with your denovo's name. It is now running on the server.
Try it
Leave and join again to see your greeting, or type /hello.
Change it
After changing a denovo that is already switched on, type /denovo reload to fetch the latest version from the
editor.
Next, Types explains why some blocks fit into a slot and others do not.