init.lua 516 B

123456789101112131415161718
  1. itemstring = itemstring or {}
  2. itemstring.modpath = minetest.get_modpath("itemstring")
  3. minetest.register_chatcommand("itemstring", {
  4. params = "",
  5. description = "Get itemstring of wielded item.",
  6. func = function(name, param)
  7. local player = minetest.get_player_by_name(name)
  8. if not player then return end
  9. if not player:is_player() then return end
  10. minetest.chat_send_player(name, "# Server: Wielded itemstack is named '" .. player:get_wielded_item():to_string() .. "'.")
  11. return true
  12. end
  13. })