# Spawn Point Management

Before using the Spawn Point API, you need to create a Spawn Point API Management object as follows:

local Spawnport = class.Spawnport.new()

The specific function name and description are as follows:

Serial number Function name Description
1 getSpawnPoint(...) Get Spawn Point
2 getChunkValidSpawnPos(...) Get chunk valid Spawn Point, which can be used as Spawn Point

# getSpawnPoint

  • Parameters and types:nil
  • Return value and types:
  • The main role of this method: Get Spawn Point
  • The specific use cases are as follows:
--Get the default birth point coordinates of the archive
local result,x,y,z=Spawnport:getSpawnPoint()
--Show in chat box
Chat:sendSystemMsg("The default birth point coordinates are:("..x..","..y..","..z..")")

# getChunkValidSpawnPos

  • Parameters and types:
  • Return value and types:
  • The main role of this method: Get chunk valid Spawn Point, which can be used as Spawn Point
  • The specific use cases are as follows:
--Randomly obtain the effective refresh point coordinates of the block (0,0,0) (the meaning is unknown)
local result,x,y,z=Spawnport:getChunkValidSpawnPos(0,0,0)
--Show in chat box
Chat:sendSystemMsg("The random effective refresh point coordinates of block(0,0,0) are:("..x..","..y..","..z..")")
Last Update: 6/11/2020, 9:30:46 PM