Skip to content

Shop run.

Every kill pays a coin. The shop book opens a shop where coins buy gear: a sword, golden apples, food and a diamond pickaxe. Defeat the dragon with what you can afford.

Players
1 to 8 players
Length
about 2 hours
Goal
Defeat the Ender Dragon.

The rules.

Each rule waits for its event, checks its if, then runs its steps in order; a branch or a loop's steps are set in.

  • Welcome

    When the challenge starts

    1. Show the title “Shop run” to everyone
    2. Give Shop to everyone
  • A kill pays a coin

    When a mob is killed

    1. Add 1 to coins
    2. Show “+1 coin ({coins})” above the hotbar of the player
  • The book opens the shop

    When a player uses Shop

    1. Open shop for the player
  • Buy: Iron sword

    When a player clicks slot 1 of the shop menu

    1. Run buy
  • Buy: Golden apples

    When a player clicks slot 3 of the shop menu

    1. Run buy
  • Buy: Cooked beef

    When a player clicks slot 5 of the shop menu

    1. Run buy
  • Buy: Diamond pickaxe

    When a player clicks slot 7 of the shop menu

    1. Run buy

Its functions.

Steps several rules run by name.

  • buy

    Takes item (an item), count (a number), price (a number), label (text)

    1. If coins is at least price
      1. Add 0 − price to coins
      2. Give count item to the player
      3. Show “{label}: yours for {price} coins. {coins} left.” above the hotbar of the player
      Otherwise
      1. Show “{label} costs {price} coins; you have {coins}.” above the hotbar of the player

What it declares.

Variables

  • coins: a number, per player, at least 0, starting at 0, on the sidebar as Coins

Custom items

  • Shop (Book)

Menus

  • The shop: 1 row, 4 slots stocked