Page 1 of 1

Respawn after dead in prison

PostPosted: Sat Sep 22, 2018 11:59
by paulvdv
Hi, I am new to Minetest, I really like the game.

I have a server with a world and some bad kids on it. For that reason I've made a prison. It's possible to escape, but that's really difficult because I revoke them everything...

My problem is that the prisoners can die, and respawn outside the prison. Is there a way that I (as the admin) can make them respawn in the prison-bed? I cannot find where the respawn location is stored, its not in
.minetest/worlds/world/players/<name> . Maybe in the database?

I am using the normal minetest_game.

Or do you know a workaround for this "problem"?

Bye,
Paul

Re: Respawn after dead in prison

PostPosted: Sat Sep 22, 2018 13:20
by Krock
Common ways to escape:

Command "/home": Revoke the "home" privileges to make it stop happening.
Death respawn in bed: Saved in "[worldname]/beds_player_spawns". Either set the minetest.conf setting "enable_bed_respawn" to "false" or use something like this in your prison mod to overwrite the last bed:
Code: Select all
beds.spawn[player:get_player_name()] = vector.new(position_of_prison_bed)
beds.save_spawns()

Teleport home in unified_inventory: Revoking "home" privilege suffices
Normal respawn on death (game without beds): Write a mod that sets the position of a player on respawn.

Re: Respawn after dead in prison

PostPosted: Sat Sep 22, 2018 13:48
by paulvdv
Krock wrote:Common ways to escape:

Command "/home": Revoke the "home" privileges to make it stop happening.
Death respawn in bed: Saved in "[worldname]/beds_player_spawns". Either set the minetest.conf setting "enable_bed_respawn" to "false" or use something like this in your prison mod to overwrite the last bed:
Code: Select all
beds.spawn[player:get_player_name()] = vector.new(position_of_prison_bed)
beds.save_spawns()

Teleport home in unified_inventory: Revoking "home" privilege suffices
Normal respawn on death (game without beds): Write a mod that sets the position of a player on respawn.


Ah, "beds_player_spawns" is what I need!
I revoke all privileges, so they don't have the home privilege.
Maybe I can create a very simple mod to put bad kids in prison, and to learn how creating a mod works.

Bye,
Paul