MiniBench

MiniBench / Learn

Project ~7 min read

Build a trivia game

Ask a question, players run onto the colored pad for their answer, then you reveal it — everyone on the right pad scores a point. It's a game-show host in a few small functions, and it scales to as many questions as you like.

1. Start and show the score

Set up a score objective on the sidebar, zero everyone out, and jump into the first question.

# functions/trivia/start.mcfunction
scoreboard objectives add score dummy "Score"
scoreboard objectives setdisplay sidebar score
scoreboard players set @a score 0
function trivia/q1
The trivia start function in the MiniBench editor setting up the score objective and asking the first question

2. Ask a question

Put the question on screen with /title. Build two answer pads out of colored wool nearby — lime for one answer, yellow for the other — and label them with signs.

# functions/trivia/q1.mcfunction
title @a title Question 1
title @a subtitle Lime = Grass, Yellow = Sand?

3. Reveal the answer

Give players a few seconds to pick a pad, then run the reveal. It checks who's standing on the correct pad (lime) and scores them — everyone else just sees the answer.

# functions/trivia/reveal1.mcfunction
execute as @a at @s if block ~ ~-1 ~ lime_wool run function trivia/correct
title @a actionbar The answer was Grass (lime)!
# functions/trivia/correct.mcfunction
scoreboard players add @s score 1
playsound random.levelup @s
title @s actionbar Correct! +1

execute as @a at @s if block ~ ~-1 ~ lime_wool is the whole judge — "for each player standing on lime, score them."

Add more questions

See it in Minecraft

The question fills the screen while the live score sits on the sidebar — players pick their pad, then you reveal.

A 'Question 1' title with the question as a subtitle and a Score sidebar in Minecraft

The quartz stage and colored answer pads in the shot are a few fills — run this once:

# functions/trivia/build.mcfunction — a stage with answer pads
fill ~-8 ~ ~-7 ~8 ~1 ~7 quartz_block
fill ~-5 ~2 ~-4 ~-1 ~2 ~2 lime_wool
fill ~1 ~2 ~-4 ~5 ~2 ~2 yellow_wool

Make it flow.

Have each reveal call the next question so the game runs itself.

Chain functions together