Rotton Meat: craftitem ABM?
I'm working on a mod to extend PilzAdam's Simple Mobs.
One of the things I wanted to include is the possibility of meat retrieved from animals that remains uncooked to turn into rotten meat.
I'm wondering if there is a function or functions that I can use to periodically check chests, player inventory, and the environment for raw meat and modify it. I tried using register_abm but it didn't work. I don't think it works with craftitems.
One of the things I wanted to include is the possibility of meat retrieved from animals that remains uncooked to turn into rotten meat.
I'm wondering if there is a function or functions that I can use to periodically check chests, player inventory, and the environment for raw meat and modify it. I tried using register_abm but it didn't work. I don't think it works with craftitems.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
--Meat Rotting--
minetest.register_craftitem("my_mobs:meat_rotten", {
description = "Rotten Meat",
image = "meat_rotten.png",
on_use = minetest.item_eat(-6),
groups = { meat=1, eatable=1 },
})
minetest.register_craft({
type = "cooking",
output = "scorched_stuff",
recipe = "my_mobs:meat_rotten",
cooktime = 5,
})
-- minetest.register_abm(
-- {nodenames = {"mobs:meat"},
-- interval = 10,
-- chance = 1,
-- action = function(pos)
-- minetest.env:add_node(pos, {name="my_mobs:meat_rotten"})
-- end,
-- })