this time I'm having trouble to grow a plant on a specific type of node.
The coral grass should be spawned on top of the coral block.
I'm getting this error message inside the client:

And there is no coral top showing up.
That is the code:
- Code: Select all
minetest.register_node("korallen:pinkcoral", {
tiles = {"koralle_block_pink.png"},
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,falling_node=1},
})
minetest.register_node("korallen:bluecoral", {
tiles = {"koralle_block_blue.png"},
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,falling_node=1},
})
minetest.register_abm({
nodenames = {"default:dirt"},
neighbors = {"group:water"},
interval = 45,
chance = 100,
action = function(pos)
pos.y=pos.y+1
minetest.add_node(pos, {name="korallen:pinkcoral"})
end,
})
minetest.register_abm({
nodenames = {"default:dirt"},
neighbors = {"group:water"},
interval = 60, -- interval per secnd
chance = 300, -- propability 1= always
action = function(pos)
pos.y=pos.y+1
minetest.add_node(pos, {name="korallen:bluecoral"})
end,
})
minetest.register_craftitem("korallen:pink_coral_grass",{
description = "pink colored coral top",
inventory_image = "koralle_top_pink.png",
wield_image = "koralle_top_pink.png"
--on_drop = function(itemstack, dropper, pos)
--itemstack:take_item()
--return itemstack
})
minetest.register_abm({
nodenames = {"korallen:pinkcoral"},
neighbors = {"group:water"},
interval = 45,
chance = 50,
action = function(pos)
pos.y=pos.y+1
minetest.add_node(pos, {name="korallen:pink_coral_grass"})
end,
})
minetest.register_craftitem("korallen:pink_coral_stick",{
description = "a pink colored coral piece",
inventory_image = "koralle_stick_pink.png",
wield_image = "koralle_block_pink.png"
--on_drop = function(itemstack, dropper, pos)
--itemstack:take_item()
--return itemstack
})
minetest.register_craft({
output = 'korallen:pink_coral_stick',
recipe = {
{'korallen:pinkcoral', '', ''},
{'korallen:pinkcoral', '', ''},
{'korallen:pinkcoral', '', ''},
}
})
minetest.register_tool('korallen:coral_pick', {
description = 'coral pickaxe',
inventory_image = 'default_tool_diamondpick.png',
tool_capabilities = {
max_drop_level=3,
groupcaps= {
cracky={times={[1]=4.00, [2]=1.50, [3]=1.00}, uses=70, maxlevel=1}
}
}
})
minetest.register_craft({
output = 'korallen:coral_pick',
recipe = {
{'korallen:pinkcoral', 'korallen:pinkcoral', 'korallen:pinkcoral'},
{'', 'korallen:pink_coral_stick', ''},
{'', 'korallen:pink_coral_stick', ''},
}
})
minetest.register_craftitem("korallen:blue_coral_stick",{
description = "a blue colored coral piece",
inventory_image = "koralle_stick_blue.png",
wield_image = "koralle_block_pink.png"
--on_drop = function(itemstack, dropper, pos)
--itemstack:take_item()
--return itemstack
})
Thans for your help! :)