Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Tutorial 1.3. Installation

Adrodoc55 edited this page Feb 12, 2017 · 18 revisions

In the second tutorial we learned about command block modifiers that make our life easier, because we don't have to manually adjust the generated command blocks. But even with these, we still have to manually set up a scoreboard for our counter to work. For this small example it was ok, but as you write bigger programs you will notice that the installation of a program can get very complicated. Therefor MPL allows you to generate the installation and uninstallation with ease.

The following program completes our counter from the previous tutorials:

install {
  /scoreboard objectives add COUNTER dummy
  /scoreboard objectives setdisplay sidebar COUNTER
}

uninstall {
  /scoreboard objectives remove COUNTER
}

repeat: /scoreboard players add @a COUNTER 1
/scoreboard players set @a[score_COUNTER_min=10] COUNTER 1

When we now import the commands into Minecraft (see Tutorial 1.1) we can see that 2 additional chains have been generated. The lower one is the installation and the upper one the uninstallation. We can install our program by simply placing a redstone block next to the start of the installation (where the stone block is in the picture). The uninstallation works just the same obviously.

Installation

Before the installation executes all your commands it also installs all processes, so they can be used in the installation. Processes can also be used in the uninstallation. We will learn more about processes in Tutorial 3.1. Remote processes.

But first you should learn how to make comments in Tutorial 1.4. Comments.