Skip to content

Instantly share code, notes, and snippets.

@fluxionary
Created February 27, 2023 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fluxionary/eee00a3e46a4b954660c70c1b58cc82a to your computer and use it in GitHub Desktop.
Save fluxionary/eee00a3e46a4b954660c70c1b58cc82a to your computer and use it in GitHub Desktop.
example code for Yad
local elapsed = 0
minetest.register_globalstep(function(dtime)
elapsed = elapsed + dtime
if elapsed < 1 then return end
elapsed = 0
for _, player in ipairs(minetest.get_connected_players()) do
local player_name = player:get_player_name()
local pos = vector.round(vector.offset(player:get_pos(), 0, -0.5, 0))
local spos = minetest.pos_to_string(pos)
local node_name = minetest.get_node(pos).name
minetest.chat_send_player(player_name, string.format("node @ %s = %s", spos, node_name))
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment