I'm making a little adventure map using a bunch of the new mechanics from the upcoming 1.14 update. I want the map to be playable for literally anyone but I also don't want to tell the player how to progress unless they really need it. Therefore I want a little hint system that detects if a player has been in a room for a really long time and then dispenses a helpful hint.
I used to be decent with command blocks, but then everything changed and there's generally much more efficient ways to do things. There are two pieces of information I'm missing to make this work.
1:What command do I use to tell if the player is in a rectangular room?
2: I'd hook up the previous command to constantly input a signal into a timer of some sort. is there a way with command blocks to count time efficiently or should I use redstone?
Then at the end of that timer I'd signal a /say command telling the player the hint.
The Meaning of Life, the Universe, and Everything.
Join Date:
2/11/2017
Posts:
662
Member Details
Checking for a rectangular room is very hard, but you could check if the player is in a circular range very easily.
I would suggest that in each room you use the following command (do not copy after "//"):
/scoreboard players set @a[distance=..(your_range_here)] room (room_number_here) //Should run every tick.
This will make sure that players in different rooms have different scores.
Then, write a command chain like this (do not copy after "//"):
/execute as @a unless score @s room = @s lastRoom run scoreboard players set @s timer 0 //Will reset the timer when a player changes rooms. Should run every tick.
/execute as @a run scoreboard players operation @s lastRoom = @s room //Will update lastRoom. Should run after the last command unconditionally.
/scoreboard players add @a timer 1 //Will update timer. This can run separately from the last two but should run every tick unconditionally.
After that, put in every room a command chain like this:
/tellraw @a[distance=..(your_range_here),scores={timer=(hint_time)}] "your_message_here" //Will give a hint to anyone in the room for (hint_time) ticks. There are 20 ticks in a second. Should run every tick.
You can do this as many times as you want, just add to your hint command block chain.
You will need to create scores "room", "lastRoom", and "timer"
To download the other ones you need to make a folder in the versions folder for minecraft and put the client and JSON file for the versions in there. They all need to be named the same aside from file extensions. Once you do that, you will be able to choose that version when making a new profile with the minecraft launcher.
I'm making a little adventure map using a bunch of the new mechanics from the upcoming 1.14 update. I want the map to be playable for literally anyone but I also don't want to tell the player how to progress unless they really need it. Therefore I want a little hint system that detects if a player has been in a room for a really long time and then dispenses a helpful hint.
I used to be decent with command blocks, but then everything changed and there's generally much more efficient ways to do things. There are two pieces of information I'm missing to make this work.
1:What command do I use to tell if the player is in a rectangular room?
2: I'd hook up the previous command to constantly input a signal into a timer of some sort. is there a way with command blocks to count time efficiently or should I use redstone?
Then at the end of that timer I'd signal a /say command telling the player the hint.
Thanks for your help!
Checking for a rectangular room is very hard, but you could check if the player is in a circular range very easily.
I would suggest that in each room you use the following command (do not copy after "//"):
/scoreboard players set @a[distance=..(your_range_here)] room (room_number_here) //Should run every tick.
This will make sure that players in different rooms have different scores.
Then, write a command chain like this (do not copy after "//"):
/execute as @a unless score @s room = @s lastRoom run scoreboard players set @s timer 0 //Will reset the timer when a player changes rooms. Should run every tick.
/execute as @a run scoreboard players operation @s lastRoom = @s room //Will update lastRoom. Should run after the last command unconditionally.
/scoreboard players add @a timer 1 //Will update timer. This can run separately from the last two but should run every tick unconditionally.
After that, put in every room a command chain like this:
/tellraw @a[distance=..(your_range_here),scores={timer=(hint_time)}] "your_message_here" //Will give a hint to anyone in the room for (hint_time) ticks. There are 20 ticks in a second. Should run every tick.
You can do this as many times as you want, just add to your hint command block chain.
You will need to create scores "room", "lastRoom", and "timer"
NOTE: This has been tested and works in 1.13
Here's a video with the commands:
Remember those versions that minecraft pranked us with? Specifically:
Those are still downloadable! Watch this video for 2.0:
https://www.youtube.com/watch?v=PQdu9LKAdIU
To download the other ones you need to make a folder in the versions folder for minecraft and put the client and JSON file for the versions in there. They all need to be named the same aside from file extensions. Once you do that, you will be able to choose that version when making a new profile with the minecraft launcher.
15w14a is on this link:
http://minecraft.gamepedia.com/15w14a
1.RV-Pre1 is here:
http://minecraft.gamepedia.com/1.RV-Pre1
Minecraft 3D is here:
https://minecraft.gamepedia.com/Java_Edition_3D_Shareware_v1.34
Ptolemy2002's answer is really good.
However, I just wanted to add this:
Depending on how your map is set up, you might be able to find a way to store what room a player enter's instead of using radius.