minetest.is_protected

From Minetest Developer Wiki
Jump to: navigation, search

Syntax

minetest.is_protected(pos, playername)

Description

Checks if the position is protected. Protection mods should override this.

Example

-- Checking a position
local spawn_protected = minetest.is_protected({x=0, y=0, z=0}, playername)
 
-- Overriding in protection mods
old_is_protected = minetest.is_protected
function minetest.is_protected(pos, name)
	if not mymod:can_interact(pos, name) then
		return true
	end
	return old_is_protected(pos, name)
end
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox