environment.lua 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. ---@meta
  2. ---Environment access functions
  3. -------------------------------
  4. ---Set node at position
  5. ---@param pos mt.Vector
  6. ---@param node mt.Node
  7. ---If param1 or param2 is omitted, it's set to `0`.
  8. ---e.g. `minetest.set_node({x=0, y=10, z=0}, {name="default:wood"})`
  9. function minetest.set_node(pos, node) end
  10. minetest.add_node = minetest.set_node
  11. ---Set node on all positions set in the first argument.
  12. ---e.g. `minetest.bulk_set_node({{x=0, y=1, z=1}, {x=1, y=2, z=2}}, {name="default:stone"})`
  13. ---For node specification or position syntax see `minetest.set_node` call
  14. ---Faster than set_node due to single call, but still considerably slower
  15. ---than Lua Voxel Manipulators (LVM) for large numbers of nodes.
  16. ---Unlike LVMs, this will call node callbacks. It also allows setting nodes
  17. ---in spread out positions which would cause LVMs to waste memory.
  18. ---For setting a cube, this is 1.3x faster than set_node whereas LVM is 20
  19. ---times faster.
  20. ---@param positions mt.Vector[]
  21. ---@param node mt.Node
  22. function minetest.bulk_set_node(positions, node) end
  23. ---Set node at position, but don't remove metadata
  24. ---@param pos mt.Vector
  25. ---@param node mt.Node
  26. function minetest.swap_node(pos, node) end
  27. ---By default it does the same as `minetest.set_node(pos, {name="air"})`
  28. ---@param pos mt.Vector
  29. function minetest.remove_node(pos) end
  30. ---Returns the node at the given position as table in the format
  31. ---`{name="node_name", param1=0, param2=0}`,
  32. ---@param pos mt.Vector
  33. ---@return mt.Node {name: "ignore", param1: 0, param2: 0} for unloaded areas.
  34. function minetest.get_node(pos) end
  35. ---Same as `get_node` but returns `nil` for unloaded areas.
  36. ---@param pos mt.Vector
  37. ---@return mt.Node?
  38. function minetest.get_node_or_nil(pos) end
  39. ---Gets the light value at the given position. Note that the light value
  40. ---"inside" the node at the given position is returned, so you usually want
  41. ---to get the light value of a neighbor.
  42. ---`pos`: The position where to measure the light.
  43. ---`timeofday`: `nil` for current time, `0` for night, `0.5` for day
  44. ---Returns a number between `0` and `15` or `nil`
  45. ---`nil` is returned e.g. when the map isn't loaded at `pos`
  46. ---@param pos mt.Vector
  47. ---@param timeofday number?
  48. ---@return integer? # number between `0` and `15` or `nil`
  49. function minetest.get_node_light(pos, timeofday) end
  50. ---Figures out the sunlight (or moonlight) value at pos at the given time of
  51. ---day.
  52. ---`pos`: The position of the node
  53. ---`timeofday`: `nil` for current time, `0` for night, `0.5` for day
  54. ---Returns a number between `0` and `15` or `nil`
  55. ---This function tests 203 nodes in the worst case, which happens very
  56. ---unlikely
  57. ---@param pos mt.Vector
  58. ---@param timeofday number?
  59. function minetest.get_natural_light(pos, timeofday) end
  60. ---Calculates the artificial light (light from e.g. torches) value from the
  61. ---`param1` value.
  62. ---`param1`: The param1 value of a `paramtype = "light"` node.
  63. ---Currently it's the same as `math.floor(param1 / 16)`, except that it
  64. ---ensures compatibility.
  65. ---@param param1 integer number between `0` and `255`
  66. ---@return integer # number between `0` and `15`
  67. function minetest.get_artificial_light(param1) end
  68. ---Place node with the same effects that a player would cause
  69. function minetest.place_node(pos, node) end
  70. ---Dig node with the same effects that a player would cause
  71. ---Returns `true` if successful, `false` on failure (e.g. protected location)
  72. ---@param pos mt.Vector
  73. ---@return boolean
  74. function minetest.dig_node(pos) end
  75. ---Punch node with the same effects that a player would cause
  76. ---@param pos mt.Vector
  77. function minetest.punch_node(pos) end
  78. ---Change node into falling node
  79. ---Returns `true` and the ObjectRef of the spawned entity if successful, `false` on failure
  80. ---@param pos mt.Vector
  81. ---@return boolean
  82. function minetest.spawn_falling_node(pos) end
  83. ---Get a table of positions of nodes that have metadata within a region
  84. ---{pos1, pos2}.
  85. ---@param pos1 mt.Vector
  86. ---@param pos2 mt.Vector
  87. ---@return mt.Vector[]
  88. function minetest.find_nodes_with_meta(pos1, pos2) end
  89. ---* Get a `NodeMetaRef` at that position
  90. ---@param pos mt.Vector
  91. ---@return mt.NodeMetaRef
  92. function minetest.get_meta(pos) end
  93. ---Get `NodeTimerRef`
  94. ---@param pos mt.Vector
  95. ---@return mt.NodeTimerRef
  96. function minetest.get_node_timer(pos) end
  97. ---Spawn Lua-defined entity at position.
  98. ---@param pos mt.Vector
  99. ---@param name string
  100. ---@param staticdata? string
  101. ---@return mt.ObjectRef? ref or `nil` if failed
  102. function minetest.add_entity(pos, name, staticdata) end
  103. ---Spawn item
  104. ---@param pos mt.Vector
  105. ---@param item mt.Item
  106. ---@return mt.ObjectRef? ref or `nil` if failed
  107. function minetest.add_item(pos, item) end
  108. ---Get an `ObjectRef` to a player
  109. ---@param name string player name
  110. ---@return mt.PlayerObjectRef player_ref
  111. function minetest.get_player_by_name(name) end
  112. ---returns a list of ObjectRefs in a sphere
  113. ---@param pos mt.Vector
  114. ---@param radius number using a Euclidean metric
  115. ---@return mt.ObjectRef[] refs
  116. function minetest.get_objects_inside_radius(pos, radius) end
  117. ---returns a list of ObjectRefs between `pos1` and `pos2`
  118. ---(min and max positions of the area to search)
  119. ---@param pos1 mt.Vector
  120. ---@param pos2 mt.Vector
  121. ---@return mt.ObjectRef[] refs
  122. function minetest.get_objects_in_area(pos1, pos2) end
  123. ---@param val number between `0` and `1`; `0` for midnight, `0.5` for midday
  124. function minetest.set_timeofday(val) end
  125. ---@return number timeofday between `0` and `1`; `0` for midnight, `0.5` for midday
  126. function minetest.get_timeofday() end
  127. ---@return number time the time, in seconds, since the world was created.
  128. function minetest.get_gametime() end
  129. ---@return number days number of days elapsed since world was created.
  130. ---accounts for time changes.
  131. function minetest.get_day_count() end
  132. ---@param pos mt.Vector
  133. ---@param radius number using a maximum metric
  134. ---@param nodenames string[]|string e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
  135. ---@param search_center boolean? optional boolean (default: `false`). If true, `pos` is also checked for the nodes
  136. ---@return mt.Vector? pos
  137. function minetest.find_node_near(pos, radius, nodenames, search_center) end
  138. ---@param pos1 mt.Vector min position of area to search
  139. ---@param pos2 mt.Vector max position of area to search
  140. ---@param nodenames string[]|string e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
  141. ---@param grouped boolean?
  142. ---@return { string: mt.Vector[] } | mt.Vector[]
  143. ---@return nil | { string: number }
  144. ---If `grouped` is `true` the return value is a table indexed by node name
  145. ---which contains lists of positions.
  146. ---If `grouped` is `false` or absent the return values are as follows:
  147. ---first value: Table with all node positions
  148. ---second value: Table with the count of each node with the node name
  149. ---as index
  150. ---Area volume is limited to 4,096,000 nodes
  151. function minetest.find_nodes_in_area(pos1, pos2, nodenames, grouped) end
  152. ---@param nodenames string[]|string e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
  153. ---@return mt.Vector[] # list of positions with a node air above
  154. ---Area volume is limited to 4,096,000 nodes
  155. function minetest.find_nodes_in_area_under_air(pos1, pos2, nodenames) end
  156. ---Get world-specific perlin noise
  157. ---The actual seed used is the noiseparams seed plus the world seed.
  158. ---@param noiseparams mt.NoiseParams
  159. ---@return mt.PerlinNoise # world-specific perlin noise
  160. function minetest.get_perlin(noiseparams) end
  161. ---Deprecated: use `minetest.get_perlin(noiseparams)` instead.
  162. ---Return world-specific perlin noise.
  163. function minetest.get_perlin(seeddiff, octaves, persistence, spread) end
  164. ---Return voxel manipulator object.
  165. ---Loads the manipulator from the map if positions are passed.
  166. ---@param pos1 mt.Vector?
  167. ---@param pos2 mt.Vector?
  168. ---@return mt.VoxelManip
  169. function minetest.get_voxel_manip(pos1, pos2) end
  170. ---Return voxel manipulator object.
  171. ---Loads the manipulator from the map if positions are passed.
  172. ---@param pos1 mt.Vector?
  173. ---@param pos2 mt.Vector?
  174. ---@return mt.VoxelManip
  175. function VoxelManip(pos1, pos2) end
  176. ---@alias mt.DecorID string|number
  177. ---Set the types of on-generate notifications that should be collected.
  178. ---
  179. ---Available flags:
  180. ---* dungeon
  181. ---* temple
  182. ---* cave_begin
  183. ---* cave_end
  184. ---* large_cave_begin
  185. ---* large_cave_end
  186. ---* decoration
  187. ---@param flags {[string]: boolean}|nil
  188. ---@param deco_ids mt.DecorID[]|nil list of IDs of decorations which notification is requested for.
  189. function minetest.set_gen_notify(flags, deco_ids) end
  190. ---@return string flags
  191. ---@return mt.DecorID[] # `deco_id`'s.
  192. function minetest.get_gen_notify() end
  193. ---@param decoration_name string
  194. ---@return mt.DecorID? # Decoration ID number for the provided decoration name string, or `nil` on failure.
  195. function minetest.get_decoration_id(decoration_name) end
  196. ---@alias mt.VoxelManipName
  197. ---|"voxelmanip"
  198. ---|"heightmap"
  199. ---|"biomemap"
  200. ---|"heatmap"
  201. ---|"humiditymap"
  202. ---|"gennotify"
  203. ---@param objectname mt.VoxelManipName
  204. ---@return mt.MapgenObject? # requested mapgen object if available
  205. function minetest.get_mapgen_object(objectname) end
  206. ---@param pos mt.Vector
  207. ---@return number? # heat at the position, or `nil` on failure.
  208. function minetest.get_heat(pos) end
  209. ---@param pos mt.Vector
  210. ---@return number? # humidity at the position, or `nil` on failure.
  211. function minetest.get_humidity(pos) end
  212. ---@class mt.BiomeData
  213. ---@field biome string
  214. ---@field heat number
  215. ---@field humidity number
  216. ---@param pos mt.Vector
  217. ---@return mt.BiomeData | nil
  218. ---Get table with biome data at position or `nil` on failure.
  219. function minetest.get_biome_data(pos) end
  220. ---@param biome_name string
  221. ---@return string # biome id, as used in the biomemap Mapgen object and returned
  222. ---by `minetest.get_biome_data(pos)`, for a given biome_name string.
  223. function minetest.get_biome_id(biome_name) end
  224. ---@param biome_id string
  225. ---@return string|nil # biome name string for the provided biome id, or `nil` on failure.
  226. ---If no biomes have been registered, such as in mgv6, returns `default`.
  227. function minetest.get_biome_name(biome_id) end
  228. ---@class mt.MapgenParams
  229. ---@field mgname string
  230. ---@field seed number
  231. ---@field chunksize number
  232. ---@field water_level number
  233. ---@field flags string
  234. ---@deprecated
  235. ---Deprecated, use `minetest.get_mapgen_setting(name)` instead.
  236. ---@return mt.MapgenParams
  237. function minetest.get_mapgen_params() end
  238. ---@deprecated
  239. ---Deprecated: use `minetest.set_mapgen_setting(name, value, override) instead.
  240. ---Set map generation parameters.
  241. ---Function cannot be called after the registration period.
  242. ---@param params mt.MapgenParams
  243. -- * Leave field unset to leave that parameter unchanged.
  244. -- * `flags` contains a comma-delimited string of flags to set, or if the
  245. -- prefix `"no"` is attached, clears instead.
  246. -- * `flags` is in the same format and has the same options as `mg_flags` in
  247. -- `minetest.conf`.
  248. function minetest.set_mapgen_params(params) end
  249. ---@return mt.Vector min minimum possible generated node position
  250. ---@return mt.Vector max maximum possible generated node position
  251. ---@param mapgen_limit? number optional limit
  252. ---If it is absent, its value is that of the *active* mapgen setting `"mapgen_limit"`.
  253. ---@param chunksize? number optional number.
  254. ---If it is absent, its value is that of the *active* mapgen setting `"chunksize"`.
  255. function minetest.get_mapgen_edges(mapgen_limit, chunksize) end
  256. ---@param name string setting name
  257. ---@return string? # mapgen setting (or nil if none exists) in string format
  258. ---with the following order of precedence:
  259. ---1. Settings loaded from map_meta.txt or overrides set during mod execution.
  260. ---2. Settings set by mods without a metafile override
  261. ---3. Settings explicitly set in the user config file, minetest.conf
  262. ---4. Settings set as the user config default
  263. function minetest.get_mapgen_setting(name) end
  264. ---@param name string setting name
  265. ---@return string|mt.NoiseParams
  266. ---Same as `minetest.get_mapgen_setting`, but returns the value as a NoiseParams table if the
  267. ---setting `name` exists and is a valid NoiseParams.
  268. ---@see minetest.get_mapgen_setting
  269. ---@see mt.NoiseParams
  270. function minetest.get_mapgen_setting_noiseparams(name) end
  271. ---Sets a mapgen param to `value`, and will take effect if the corresponding
  272. ---mapgen setting is not already present in map_meta.txt.
  273. ---@param name string setting name
  274. ---@param value any value
  275. ---@param override_meta? boolean if true, overrides value in map metafile
  276. ---Note: to set the seed, use `"seed"`, not `"fixed_map_seed"`.
  277. function minetest.set_mapgen_setting(name, value, override_meta) end
  278. ---Sets a mapgen noise param to `value`, and will take effect if the corresponding
  279. ---mapgen setting is not already present in map_meta.txt.
  280. ---@param name string
  281. ---@param value mt.NoiseParams
  282. ---@param override_meta? boolean if true, overrides value in map metafile
  283. function minetest.set_mapgen_setting_noiseparams(name, value, override_meta) end
  284. ---Sets the noiseparams setting of `name` to the noiseparams table specified
  285. ---in `noiseparams`.
  286. ---@param name string
  287. ---@param noiseparams mt.NoiseParams
  288. ---@param set_default? boolean specifies whether the setting should be
  289. ---applied to the default config or current active config
  290. function minetest.set_noiseparams(name, noiseparams, set_default) end
  291. ---@param name string
  292. ---@return table # table of the noiseparams for name.
  293. function minetest.get_noiseparams(name) end
  294. ---Generate all registered ores within the VoxelManip `vm` and in the area
  295. ---from `pos1` to `pos2`.
  296. ---`pos1` and `pos2` are optional and default to mapchunk minp and maxp.
  297. ---@param vm mt.VoxelManip
  298. ---@param pos1 mt.Vector
  299. ---@param pos2 mt.Vector
  300. function minetest.generate_ores(vm, pos1, pos2) end
  301. ---Generate all registered decorations within the VoxelManip `vm` and in the
  302. ---area from `pos1` to `pos2`.
  303. ---`pos1` and `pos2` are optional and default to mapchunk minp and maxp.
  304. ---@param vm mt.VoxelManip
  305. ---@param pos1 mt.Vector
  306. ---@param pos2 mt.Vector
  307. function minetest.generate_decorations(vm, pos1, pos2) end
  308. ---Clear all objects in the environment
  309. ---@param options? {mode: "full"|"quick"}
  310. ---* mode = `"full"`: Load and go through every mapblock, clearing
  311. --- objects (default).
  312. ---* mode = `"quick"`: Clear objects immediately in loaded mapblocks,
  313. --- clear objects in unloaded mapblocks only when the
  314. --- mapblocks are next activated.
  315. function minetest.clear_objects(options) end
  316. ---Load the mapblocks containing the area from `pos1` to `pos2`.
  317. ---@param pos1 mt.Vector
  318. ---@param pos2? mt.Vector defaults to `pos1` if not specified.
  319. ---This function does not trigger map generation.
  320. function minetest.load_area(pos1, pos2) end
  321. ---@enum mt.EmergeAction
  322. local EmergeAction = {
  323. EMERGE_CANCELLED = 0,
  324. EMERGE_ERRORED = 1,
  325. EMERGE_FROM_MEMORY = 2,
  326. EMERGE_FROM_DISK = 3,
  327. EMERGE_GENERATED = 4,
  328. }
  329. minetest.EMERGE_CANCELLED = EmergeAction.EMERGE_CANCELLED
  330. minetest.EMERGE_ERRORED = EmergeAction.EMERGE_ERRORED
  331. minetest.EMERGE_FROM_MEMORY = EmergeAction.EMERGE_FROM_MEMORY
  332. minetest.EMERGE_FROM_DISK = EmergeAction.EMERGE_FROM_DISK
  333. minetest.EMERGE_GENERATED = EmergeAction.EMERGE_GENERATED
  334. ---Queue all blocks in the area from `pos1` to `pos2`, inclusive, to be
  335. ---asynchronously fetched from memory, loaded from disk, or if inexistent,
  336. ---generates them.
  337. ---If `callback` is a valid Lua function, this will be called for each block
  338. ---emerged.
  339. ---@param pos1 mt.Vector
  340. ---@param pos2 mt.Vector
  341. ---@param callback? fun(blockpos: boolean, action: mt.EmergeAction, calls_remaining: integer, param: any)
  342. ---@param param any user-defined parameter passed to callback
  343. function minetest.emerge_area(pos1, pos2, callback, param) end
  344. ---Delete all mapblocks in the area from pos1 to pos2, inclusive.
  345. ---@param pos1 mt.Vector
  346. ---@param pos2 mt.Vector
  347. function minetest.delete_area(pos1, pos2) end
  348. ---Checks if there is anything other than air between pos1 and pos2.
  349. ---Returns false if something is blocking the sight.
  350. ---Returns the position of the blocking node when `false`
  351. ---@param pos1 mt.Vector First position
  352. ---@param pos2 mt.Vector Second position
  353. ---@return boolean # false if something is blocking the sight
  354. ---@return mt.Vector # the position of the blocking node when `false`
  355. function minetest.line_of_sight(pos1, pos2) end
  356. ---Creates a `Raycast` object.
  357. ---@param pos1 mt.Vector start of the ray
  358. ---@param pos2 mt.Vector end of the ray
  359. ---@param objects boolean if false, only nodes will be returned. Default is `true`.
  360. ---@param liquids boolean if false, liquid nodes (`liquidtype ~= "none"`) won't be returned. Default is `false`.
  361. ---@return mt.Raycast
  362. function minetest.raycast(pos1, pos2, objects, liquids) end
  363. ---returns table containing path that can be walked on
  364. ---@param pos1 mt.Vector start position
  365. ---@param pos2 mt.Vector end position
  366. ---@param searchdistance number maximum distance from the search positions to search in.
  367. ---In detail: Path must be completely inside a cuboid. The minimum
  368. ---`searchdistance` of 1 will confine search between `pos1` and `pos2`.
  369. ---Larger values will increase the size of this cuboid in all directions
  370. ---@param max_jump number maximum height difference to consider walkable
  371. ---@param max_drop number maximum height difference to consider droppable
  372. ---@param algorithm? "A*_noprefetch"|"A*"|"Dijkstra" algorithm
  373. ---`"A*_noprefetch"` is default
  374. ---Difference between `"A*"` and `"A*_noprefetch"` is that
  375. ---`"A*"` will pre-calculate the cost-data, the other will calculate it
  376. ---on-the-fly
  377. ---@return mt.Vector[]? # a table of 3D points representing a path from `pos1` to `pos2`
  378. ---or `nil` on failure.
  379. ---Reasons for failure:
  380. --- * No path exists at all
  381. --- * No path exists within `searchdistance` (see below)
  382. --- * Start or end pos is buried in land
  383. function minetest.find_path(pos1, pos2, searchdistance, max_jump, max_drop, algorithm) end
  384. ---Spawns L-system tree at given `pos` with definition in `treedef` table
  385. ---@param pos mt.Vector
  386. ---@param treedef mt.TreeDef
  387. function minetest.spawn_tree(pos, treedef) end
  388. ---Add node to liquid flow update queue
  389. ---@param pos mt.Vector
  390. function minetest.transforming_liquid_add(pos) end
  391. ---Get max available level for leveled node
  392. ---@param pos mt.Vector
  393. ---@return number level
  394. function minetest.get_node_max_level(pos) end
  395. ---Get level of leveled node (water, snow)
  396. ---@param pos mt.Vector
  397. ---@return number level
  398. function minetest.get_node_level(pos) end
  399. ---Set level of leveled node, default `level` equals `1`
  400. ---@param pos mt.Vector
  401. ---@param level number
  402. ---if `totallevel > maxlevel`, returns rest (`total-max`).
  403. function minetest.set_node_level(pos, level) end
  404. ---increase level of leveled node by level, default `level` equals `1`
  405. ---@param pos mt.Vector
  406. ---@param level number
  407. ---if `totallevel > maxlevel`, returns rest (`total-max`)
  408. ---`level` must be between -127 and 127
  409. function minetest.add_node_level(pos, level) end
  410. ---Resets the light in a cuboid-shaped part of
  411. ---the map and removes lighting bugs.
  412. ---Loads the area if it is not loaded.
  413. ---@param pos1 mt.Vector is the corner of the cuboid with the least coordinates
  414. ---(in node coordinates), inclusive.
  415. ---@param pos2 mt.Vector is the opposite corner of the cuboid, inclusive.
  416. ---The actual updated cuboid might be larger than the specified one,
  417. ---because only whole map blocks can be updated.
  418. ---The actual updated area consists of those map blocks that intersect
  419. ---with the given cuboid.
  420. ---However, the neighborhood of the updated area might change
  421. ---as well, as light can spread out of the cuboid, also light
  422. ---might be removed.
  423. ---@return boolean # `false` if the area is not fully generated,
  424. ---`true` otherwise
  425. function minetest.fix_light(pos1, pos2) end
  426. ---Causes an unsupported `group:falling_node` node to fall and causes an
  427. ---unattached `group:attached_node` node to fall.
  428. ---Does not spread these updates to neighbors.
  429. ---@param pos mt.Vector
  430. function minetest.check_single_for_falling(pos) end
  431. ---Causes an unsupported `group:falling_node` node to fall and causes an
  432. ---unattached `group:attached_node` node to fall.
  433. ---Spread these updates to neighbors and can cause a cascade
  434. ---of nodes to fall.
  435. ---@param pos mt.Vector
  436. function minetest.check_for_falling(pos) end
  437. ---Returns a player spawn y co-ordinate for the provided (x, z)
  438. ---co-ordinates, or `nil` for an unsuitable spawn point.
  439. ---For most mapgens a 'suitable spawn point' is one with y between
  440. ---`water_level` and `water_level + 16`, and in mgv7 well away from rivers,
  441. ---so `nil` will be returned for many (x, z) co-ordinates.
  442. ---The spawn level returned is for a player spawn in unmodified terrain.
  443. ---The spawn level is intentionally above terrain level to cope with
  444. ---full-node biome 'dust' nodes.
  445. ---@param x number
  446. ---@param z number
  447. ---@return mt.Vector
  448. function minetest.get_spawn_level(x, z) end