TransWikia.com

Is there a way to have a Command Block ask for Player Input?

Arqade Asked on June 1, 2021

I want to set a Command Block that is hidden so when the player activates it by a button it’ll give them an enchanted item based off their input. (the first part of a greater system)

so far I can use /give @p iron_sword 1 0 {ench:[{id:16,lvl:10}]} to give an Iron Sword with a Level 10 Sharpness Enchantment.

What I want to do is alter the above command so iron_sword, 16 and 10 can be inputted by the player (who will have a guide), so when the player activates the command block from a button they’ll be asked to input these values. however when I google search minecraft command block player input i’m either getting “player input” as in the interface of the command block you create the commands or using /testfor

So how can I alter the command above so the player is asked to input the values?

NOTE: this is for 1.7.10

One Answer

An exemple of trigger use:

scoreboard objectives add question trigger
scoreboard players enable @a question
/tellraw @a ["",{"text":"Do you think it will help you ? ","color":"gold","bold":"true"},{"text":"Yes","color":"green","bold":"true","clickEvent":{"action":"run_command","value":"/trigger question set 1"}},{"text":" ","color":"none","bold":"false"},{"text":"No","color":"red","bold":"true","clickEvent":{"action":"run_command","value":"/trigger question set 2"}}]
execute @a[score_question=1] ~ ~ ~ tell @p You answered Yes
execute @a[score_question_min=2] ~ ~ ~ tell @p You answered No

Answered by bZx on June 1, 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