minetest.node_dig

From Minetest Developer Wiki
Jump to: navigation, search

Contents

Syntax

minetest.node_dig(pos, node, digger)

Description

Checks if node can be dug, puts item into inventory, removes node. This is the default function called for a node if a its on_dig() callback has not been set.

Calls functions registered by minetest.register_on_dignode()

Example

local old_node_dig = minetest.node_dig
function minetest.node_dig(pos, node, digger)
	if not areas.canInteract(pos, digger:get_player_name()) then
		minetest.chat_send_player(digger:get_player_name(), "This area is protected by "..areas:getOwners(pos))
		return	
	else
		return old_node_dig(pos, node, digger)
	end
end

See also

minetest.dig_node

Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox