Use Command Blocks to teleport Dead Players?

1,544 views
Skip to first unread message

Mr. Joice

unread,
Jun 23, 2014, 5:25:55 PM6/23/14
to minecraft...@googlegroups.com
Hey MinecraftEDU folks!

I've scoured the Internet for help on this topic, but alas, I cannot find the answer I'm looking for.

I'm currently using Survival Mode to teach a Biome Exploration class (using Biomes O Plenty).  However, the issue I'm having is that kids will suicide to refill their hunger bar.  I've removed all modes of teleportation, but they still feel that it's easier to die than to get food.  I certainly appreciate their creativity in finding work arounds.  But I want to encourage them to grow farms, look for animals to make animal farms, etc.

So: how would I set up Command Blocks to detect player deaths AND teleport them to specific "wait" area?  The goal is that a 2 or 3 minute "freeze" for each death would dissuade them from suiciding.

I'm not interested in anything punitive; I want the cost for suicide to be too high for them to consider it a solution.

I know to set up using DeathCount on the /Scoreboard with these commands:

/scoreboard objectives add Deaths deathCount
/scoreboard objectives setdisplay sidebar Deaths

But after that, I have no clue what to do.  

Thanks for any help you guys can offer!
--Mr Joice

Michael Harvey

unread,
Jun 23, 2014, 7:03:51 PM6/23/14
to minecraft...@googlegroups.com
Those scoreboard commands look fine to me. I'm assuming you tried that after your class? You can test that they are working by having a player die after using the commands.

As to your question, could it be solved by simply moving the Spawn Block to your designated wait area?

EduElfie

unread,
Jun 23, 2014, 7:43:05 PM6/23/14
to minecraft...@googlegroups.com
I think the spawn block is the 'neatest' solution, however if you really want to go down the command block path you could use the following.

1 - /tp @a[score_deathcount_min=1,score_deathcount=1] x y z (these coords should be on top of another pressure plate)

then you would need to set up a 'dummy' scoreboard with a name like 'wait'
when you teleport students you want to also give them a wait score of 300 

2 - /scoreboard objectives set @a[r=2] wait 300 <- this is under the pressure plate you teleport students to,

then reset their death count

3 - /scoreboard objectives set @a[r=2] deathcount 0

you will then need to teleport them away again, to your wait room,

4 - /to @a[score_wait_min=300,score_wait=300] x y z (these coords should be to your wait room.

Underneath the wait room you will need another command block that is

5 - /scoreboard objectives remove @a[r=y,scoreboard_wait_min=0] wait x (where x is a number that is being subtracted and y is the radius of your wait room, you will want to adjust this depending on the speed of your clock).

Now that we have all the commands out of the way here is how I would set this up.

Wait room is at world spawn, underneath world spawn is a redstone clock running command blocks 1 and 5

Intermediate teleport room can be anywhere, just not really close to the wait room and the blocks need to be 'triggered' in order, 2 then 3 then 4

Clear as mud right?

The reason we use world spawn for the clock is because those chunks are always loaded, I would recommend a hopper clock too, less lag is caused by these and there are plenty of tutorials on how to create them.

Elfie.

Mr. Joice

unread,
Jun 23, 2014, 8:11:22 PM6/23/14
to minecraft...@googlegroups.com
Thanks @Elfie.  I knew one of your MCEDU regulars would have a great solution.

The problem with the spawn block is that the kids use the beds as a respawn point.  I definitely am all for "neat" solutions, as they are usually most effective and less likely to break.  But in this case, I also wanted to beef up my MC command block practice.

I'm going to put it all together now.  Thanks so much!

EduElfie

unread,
Jun 23, 2014, 8:49:02 PM6/23/14
to minecraft...@googlegroups.com
hmmm, I forgot that you will need to have a command block checking to see if they have done their 300 wait time, or one that 'tests' the area around the wait room and only lets them pass once their wait time is 0. The issue with this is that they will always have to restart from spawn, not from their bed location.'

Elfie.

EduElfie

unread,
Jun 23, 2014, 8:54:05 PM6/23/14
to minecraft...@googlegroups.com
one possible workaround (and completely untested) is using the educommand freeze on an individual student with a deathcount of one with a wait time of 300 again as educommands now worth within command blocks (in the latest build) but I would need to have some serious thinking about how to implement.

Basically my plan would be, if someone has a deathcount of 1, set their wait time to 300 and then freeze them, then count that down the wait time with a clock and command block, then once it hits 0, reset their deathcount and unfreeze them. This way they would be at their bed, but frozen…

Just a thought.

Elfie.

Michael Harvey

unread,
Jun 23, 2014, 9:30:44 PM6/23/14
to minecraft...@googlegroups.com
This has obvious pros/cons but disabling the night cycle would make beds useless. This would make the spawn block strategy work more smoothly and let your kids focus more on constant farming. No nighttime might change the lesson in a way you don't want too though. Just a thought.

MisterA

unread,
Jun 23, 2014, 11:17:23 PM6/23/14
to minecraft...@googlegroups.com
Hey Mr. Joice,

So I have come across this myself several times. Here are two ways I have dealt with it.

1. Only allow them one death, then they sit for the rest of the period, with a paper and pencil and write about the decisions they made that led to their death. Trust me they will only do / see someone have to do this once, before they understand the value of life in survival mode. You may find someone try to respawn fast before you see, but that leads me to the second option.

2. Provide them with a journal...a survival diary if you will. In it they should document any discoveries or coordinates of interesting land features and even what happened to them that day / play session. See the reason this helps is, if they die...they lose the book unless they can get back to it in time. Suicide to refill becomes less of an option.

3. Give each of them an item they cannot get on their own. If they die, and there is ever an discussion on if they did die and respawn, ask them to show you the item you gave them. This of course works only if they have died and haven't returned to their body to collect their stuff.

Just to add some thoughts to your scoreboard idea. Scoreboard seems to have a range where students in that range see the deaths, but not everyone will. It may sync up when everyone gets together, but I am not sure and haven't tested it. Also, when you use the sidebar, it seems to cap at about 12 students of data...and I have seen at times it will reset itself. I would suggest using the "list" display instead if you choose to go down this road.

Anyway, just my thought on the topic.

Mr. Joice

unread,
Jun 24, 2014, 9:44:20 AM6/24/14
to minecraft...@googlegroups.com
Great idea!  However, as you said, I do need the night cycle for this particular class to work.  It would definitely work for another class I have in mind, though.

Thanks!

Mr. Joice

unread,
Jun 24, 2014, 9:48:16 AM6/24/14
to minecraft...@googlegroups.com
Thanks, MisterA!

I LOVE the concept behind #2.  Provide them with something they've really invested in, and that personal investment (something positive) is more motivating to them than something punitive (something negative) that I do.

Gold.

If I can't get Elfie's stuff to work then yours is my backup.

Thanks!
Reply all
Reply to author
Forward
0 new messages