Cuberite Forum
BlockType constants? - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: BlockType constants? (/thread-2020.html)



BlockType constants? - Nixtren - 06-21-2015

Hi,

Suppose the following function:
function OnPlayerPlacingBlock(Player, BlockX, BlockY, BlockZ, BlockType, BlockMeta)

Is there any way to do something like this?
if BlockType == BLOCKTYPE_CHEST then
    -- Do something
end

It's because I don't like the ideia of determining the BlockType by experimental ways, are there any constants like these? I couldn't find any.


RE: BlockType constants? - warmist - 06-21-2015

in page: http://mc-server.xoft.cz/LuaAPI/Globals.html#constants search for E_BLOCK_


RE: BlockType constants? - DiamondToaster - 06-22-2015

And if you really had to, you could also use the block ID from a list in a pinch.