Cuberite Forum
Player:GetLastBedPos() for any world - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: Player:GetLastBedPos() for any world (/thread-2950.html)



Player:GetLastBedPos() for any world - moiko89 - 05-18-2017

Hi,

can i get a LastBedPos for another world?
If the player has a bed in World1 and World2?


RE: Player:GetLastBedPos() for any world - xoft - 05-18-2017

I believe there's only one LastBedPos per player, and it has a LastBedWorld tied to it somehow (not sure). I.e. if a player dies in any world, they are sent to their LastBedPos at their LastBedWorld.


RE: Player:GetLastBedPos() for any world - moiko89 - 05-18-2017

(05-18-2017, 07:06 AM)xoft Wrote: I believe there's only one LastBedPos per player, and it has a LastBedWorld tied to it somehow (not sure). I.e. if a player dies in any world, they are sent to their LastBedPos at their LastBedWorld.

Ah okay, then i will add a funtion for save bed by world in my plugin. Its okay to modify the /cb/player.ini for this or its better to make a new  ini file?


RE: Player:GetLastBedPos() for any world - Seadragon91 - 05-18-2017

Create a new file for it in the plugin working folder:
Example:
<plugin name>/players/<UUID from player>.ini
or
<plugin name>/players.ini


RE: Player:GetLastBedPos() for any world - xoft - 05-18-2017

Even better, use a sqlite database for all the positions in a single file.