This is possible indeed! You first need to have a working GPS System:
Okay so here is what the program will need to do:
- Pocket computer will constantly obtain your x,y,z location, (every 0.5) seconds,
- Then it will need to check whether your Y value is below 0,
- If you are below it then it will send a message to a server computer that will be connected to a command block
- This will set the command block to teleport you to a safe area,
- A safe area will need to be set on the server computer.
How to do this? okay so in total you will need 5 computers and 1 wireless pocket computer.
The pocket computer will be checking your location (x,y,z) using the gps station you will need to set up (Links below).
The server computer will be waiting for requests to teleport them to a safe area.
So make a safe area in your world, get the x,y,z values (F3 will show you them) and write them down somewhere
get the ID's of the pocket pc and the server.
Follow the instructions on this site or watch the youtube video (if not on link, just search gps-deploy)
http://www.computerc...dated-04012014/Please note to do the following you will need to set your modem distance to 9999999999999999999999999999 and put a world anchor by the gps servers and the safety net server.
I have added a bit of simple code for you:
Main Server (Example ID: 12)
-- Safety Net
-- Created By DannySMc
version = 1
tpCount = 0
commandBlock = "top"
-- Safe Zone
intX = 50
intY = 70
intZ = 50
local function cs(txtColour)
term.clear()
term.setCursorPos(1,1)
if txtColour then
term.setTextColour(colours[txtColour])
end
end
local function main()
cs("lime")
print("Safety Net Server - Version: "..version)
print(" ")
while true do
print("> Safety Catch Count: "..tpCount)
local args = { os.pullEvent() }
if args[1] == "rednet_message" then
if args[3] == "catch_me" then
local nID, sUsername = rednet.receive(2)
commandBlock.setCommand("/tp "..sUsername.." "..intX.." "..intY.." "..intZ)
commandBlock.runCommand()
end
end
end
end
-- runs the main program
main()
This would run on your safety net server.
Pocket Computer:
-- Safety Net Pocket Computer Program
-- Created By DannySMc
version = 1
sUsername = "Add_Your_Username"
local function cs(txtColour)
term.clear()
term.setCursorPos(1,1)
if txtColour then
term.setTextColour(colours[txtColour])
end
end
local function main()
print("> Safety Net is running...")
print("> Version: "..version)
while true do
intX, intY, intZ = gps.locate(1)
if intY < 0 then
rednet.send(12, "catch_me")
rednet.send(12, sUsername)
end
sleep(0.5)
end
end
main()
There you go :)/> Not tested it, but should work.