get-biome-data/init.lua

19 lines
654 B
Lua
Raw Permalink Normal View History

2023-06-21 20:05:06 +02:00
2024-11-08 21:47:10 +01:00
core.register_craftitem("get_biome_data:wand", {
2023-06-21 20:05:06 +02:00
description = "Biome Data Wand\n(right-click to get biome data in node's position)",
inventory_image = "get_biome_data_wand.png",
groups = {tool = 1},
on_place = function(itemstack, player, pointed_thing)
2024-11-08 21:47:10 +01:00
local biomedata = core.get_biome_data(pointed_thing.under)
2023-06-21 20:05:06 +02:00
local str =
2024-11-08 21:47:10 +01:00
core.colorize("#aaa", "Biome: ")
.. core.colorize("#0f0", core.get_biome_name(biomedata.biome))
.. " ( heat: " .. core.colorize("#f00", biomedata.heat) .. ", humidity: " .. core.colorize("#55f", biomedata.humidity) .. ")"
2023-06-21 20:05:06 +02:00
2024-11-08 21:47:10 +01:00
core.chat_send_player(player:get_player_name(), str)
2023-06-21 20:05:06 +02:00
return itemstack
end,
})