mirror of
https://codeberg.org/tenplus1/farming.git
synced 2025-01-29 02:10:18 +01:00
1 in 3 chance of raw potato being poisonous
This commit is contained in:
parent
a7694d26c7
commit
ee993f9d61
@ -14,7 +14,16 @@ minetest.register_craftitem("farming:potato", {
|
|||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1")
|
return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1")
|
||||||
end,
|
end,
|
||||||
on_use = minetest.item_eat(1),
|
-- on_use = minetest.item_eat(1),
|
||||||
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
|
if user then
|
||||||
|
if math.random(1, 3) == 1 then
|
||||||
|
return minetest.do_item_eat(-1, nil, itemstack, user, pointed_thing)
|
||||||
|
else
|
||||||
|
return minetest.do_item_eat(1, nil, itemstack, user, pointed_thing)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- baked potato
|
-- baked potato
|
||||||
|
Loading…
Reference in New Issue
Block a user