minetest.register_on_joinplayer

From Minetest Developer Wiki
Jump to: navigation, search

Syntax

Description

Register a callback to be called when a player joins the game.

Note that some functions do not work correctly when called from the callback. For example, minetest.chat_send_player does not work when sending a message to the player that has just joined. If you want to send a message to the player that has just joined, you can try adding a call to minetest.after with a suitable delay.

Example

minetest.register_on_joinplayer(function(player)
	minetest.chat_send_all("Give a warm welcome to "..player:get_player_name().."!")
end)
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox