minetest.register_on_player_receive_fields

From Minetest Developer Wiki
Jump to: navigation, search

Syntax

minetest.register_on_player_receive_fields(function(player, "formname", {fields}))

Description

Called when a button is pressed in player's inventory form, newest functions are called first. If function returns true, remaining functions are not called.

If a player uses ESC to exit a formspec, this will return {["quit"] = "true"}.

Examples

minetest.register_on_player_receive_fields(function(player, formname, fields)
	if formname == "default:team_choose" then -- This is your form name
		print("Player "..player:get_player_name().." submitted fields "..dump(fields))
	end
end)
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox