TransWikia.com

How to make a Minecraft Command Block say multiple things?

Arqade Asked on February 10, 2021

Is there a way to make a MC command block say multiple things? I am currently making a SCP minecraft world, and want to know if I can make the elevator say a couple things. Is it possible, to make it so if you press the button once, it says "You called the elevator" then the next time you press it, it says "You already called the elevator".

One Answer

In 1.12 you need at least 7 command blocks, possibly 8 if you want to reset it again, first run the following command in chat:

"/scoreboard objectives add ElevatorClicks dummy Elevator button presses"

Then get a command block and place it after the button put the following command into it:

"/scoreboard players add @p ElevatorClicks 1"

Then get a repeating command block either by giving one or by placing one and putting it in repeat mode. Place it near the elevator and put the following command in it:

"/testfor @a[score_ElevatorClicks_min=1,score_ElevatorClicks=1]"

Place a conditional chain command block behind it and place this command in it:

"/say You called the elevator"

Place a normal chain after it with the following command:

"/scoreboard players add @a[score_ElevatorClicks_min=1,score_ElevatorClicks=1] ElevatorClicks 1"

Place another chain with the following command:

"/testfor @a[score_ElevatorClicks_min=3,score_ElevatorClicks=3]"

Place a conditional chain command block behind it with this command:

"/say You already called the elevator"

Place a last chain with this command:

"/scoreboard players set @a[score_ElevatorClicks_min=3,score_ElevatorClicks=3] ElevatorClicks 2"

For a resetting command block place a normal command block that can be triggered either by a button or by some other signal. Paste the following command in it:

"/scoreboard players set @a ElevatorClicks 0"

(ElevatorClicks can be any name so can the things after /say)

(If your in 1.13 look here) In 1.13 it takes 5/6 and you do the following. Run the first command in chat:

"/scoreboard objectives add ElevatorClicks dummy Elevator button presses"

Place a command block after the button and place this command in it:

"/scoreboard players add @p ElevatorClicks 1"

Then get a repeating command block and place it somewhere near the elevator. Put in this command:

"/execute if entity @a[scores={ElevatorClicks=1}] run say You called the elevator"

Then put on a chain with this command:

"/scoreboard players add @a[scores={ElevatorClicks=1}] ElevatorClicks 1"

Put on another chain with this command:

"/execute if entity @a[scores={ElevatorClicks=3}] run say You already called the elevator"

And a last chain with this command:

"/scoreboard players set @a[scores={ElevatorClicks=3}] ElevatorClicks 2"

For a resetting commandblock place a normal one with this command:

"/scoreboard players set @a ElevatorClicks 0"

And make sure you can trigger it.

Answered by CdRHelps on February 10, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP