title
Displays a title, subtitle to the selected players.
gameplay.title(mobs.target(ALL_PLAYERS), "Title", "Sub title");
This block is very useful to give instructions on mini games.
Parameters
- target: a target selector that determines which players will receive the block or item
- title: the large font title to display
- sub title: the secondary title to display (optional)
Example
In the treasure mini-game below, a diamond is placed randomly around the current positions. All players are then teleported to the location and shown a message to start looking for the diamond.
player.onChat("hunt", function () {
blocks.place(DIAMOND_BLOCK, pos(Math.randomRange(-10, 10), Math.randomRange(-3, -2), Math.randomRange(-10, 10)))
mobs.teleportToPosition(
mobs.target(ALL_PLAYERS),
pos(0, 0, 0)
)
gameplay.title(mobs.target(ALL_PLAYERS), "READY?", "Find the hidden diamond!")
})