material = import("$.Material")
color = newInstance("#.wrappers.ChatColorWrapper", {plugin.getPlugin()})
-- An inspect command with an event to tell what a block is
local inspectCommand = plugin.addCommand({name="inspect"}, function(cmd)
local sender = cmd.getSender()
-- Make sure it's a player sending the command
if not cmd.isPlayerSender() then
sender:sendMessage(color.DARK_RED:toString() .. "Only players can run this command!")
-- Go through every inspector and check if any equals this players uuid
for k,v in pairs(inspecters) do
if v == sender:getUniqueId() then
-- Remove them from inspectors and tell them
table.remove(inspecters, k)
sender:sendMessage(color.YELLOW .. "You are no longer an inspector")
-- Else, add them and tell them
table.insert(inspecters, sender:getUniqueId())
sender:sendMessage(color.YELLOW .. "You are now an inspector")
plugin.registerEvent("BlockBreakEvent", function(e)
-- Go through every inspector and check if any equals this players uuid
for _,v in pairs(inspecters) do
if v == e:getPlayer():getUniqueId() then
e:getPlayer():sendMessage(color.AQUA .. "That is " .. color.GOLD .. e:getBlock():getType():name())