items.lua 588 B

1234567891011121314151617181920212223
  1. minetest.register_craftitem('unicorn:feather', {
  2. description = 'Unicorn Feather',
  3. inventory_image = 'unicorn_feather.png',
  4. stack_max = 20
  5. })
  6. minetest.register_craftitem('unicorn:horn', {
  7. description = 'Unicorn Horn',
  8. inventory_image = 'unicorn_horn.png',
  9. stack_max = 20
  10. })
  11. minetest.register_craftitem('unicorn:apple', {
  12. description = 'Unicorn Treat',
  13. inventory_image = 'unicorn_apple.png',
  14. on_use = function(itemstack, user, pointed_thing)
  15. local hp = user:get_hp()
  16. user:set_hp(hp+20)
  17. itemstack:take_item(1);
  18. return itemstack
  19. end
  20. })