diff --git a/builtin/client/util.lua b/builtin/client/util.lua index e85727436..aea15e00f 100644 --- a/builtin/client/util.lua +++ b/builtin/client/util.lua @@ -54,3 +54,7 @@ end function core.close_formspec(formname) return core.show_formspec(formname, "") end + +function core.get_nearby_objects(radius) + return core.get_objects_inside_radius(core.localplayer:get_pos(), radius) +end diff --git a/doc/client_lua_api.txt b/doc/client_lua_api.txt index c7bbe1609..94d40fe2a 100644 --- a/doc/client_lua_api.txt +++ b/doc/client_lua_api.txt @@ -934,6 +934,8 @@ Call these functions only at load time! * `minetest.get_objects_inside_radius(pos, radius)`: returns a list of ClientObjectRefs. * `radius`: using an euclidean metric +* `minetest.get_nearby_objects(radius)` + * alias for minetest.get_objects_inside_radius(minetest.localplayer:get_pos(), radius) * `minetest.disconnect()` * Disconnect from the server and exit to main menu. * Returns `false` if the client is already disconnecting otherwise returns `true`.