Hey,
I checked your code and corrected it.
I think you want to run the code only if it's a player
Also corrected the item that you want to have as a new pickup.
Here you can find a list of all values
http://api-docs.cuberite.org/Globals.html
function OnBlockToPickups(a_World, a_Digger, a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, a_Pickups)
-- Check if digger is null or is not a player
if (a_Digger == nil) or (a_Digger:GetEntityType() ~= cEntity.etPlayer) then
return false
end
-- Check if the block is a iron ore
if (a_BlockType ~= E_BLOCK_IRON_ORE) then
return true
end
-- Clear all defaul pickups
a_Pickups:Clear();
-- Add iron ingot
a_Pickups:Add(cItem(E_ITEM_IRON))
return true
end
If you mean red lines in the terminal, this can be a error inside of cuberite or something gone wrong in a plugin. If the error is from a plugin it's a stack trace, that contains the plugin name and the line of the error.
In this case I think it was the wrong item type, because it was nil and adding a nil value will cause an error.