item eat/de

From Minetest Developer Wiki
Jump to: navigation, search
Mbox warning.png This page has been proposed for deletion for the following reason: "The correct page is minetest.item_eat/de"
If you don't think that this page should be deleted, please explain why on the talk page.
Language: English  • Deutsch

Contents

Syntax

minetest.item_eat(hp_change, replace_with_item)

Description

Eat the item. replace_with_item can be nil. Returns a function for the on_use callback in the node, tool, or craft item definition table.

Example

minetest.register_node("default:apple", {
	description = "Apple",
	drawtype = "plantlike",
	visual_scale = 1.0,
	tiles ={"default_apple.png"},
	inventory_image = "default_apple.png",
	paramtype = "light",
	sunlight_propagates = true,
	walkable = false,
	groups = {fleshy=3,dig_immediate=3},
	on_use = minetest.item_eat(4),
	sounds = default.node_sound_defaults(),
})

See also

minetest.do_item_eat

Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox