minetest.get_objects_inside_radius

From Minetest Developer Wiki
Jump to: navigation, search

Syntax

minetest.get_objects_inside_radius(pos, radius)

Description

Returns list of ObjectRefs for objects found within radius distance of position pos, including Players and LuaEntitySAOs.

Example

local all_objects = minetest.get_objects_inside_radius({x=0, y=0, z=0}, 50)
local players = {}
local _,obj
for _,obj in ipairs(all_objects) do
	if obj:is_player() then
		table.insert(players, obj)
	end
end
print(#players .. " players found")
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox