api.txt 1.5 KB

123456789101112131415161718192021222324252627282930
  1. API functions:
  2. hot_air_balloons.get_entity(name, mesh_name, texture_name)
  3. arguments:
  4. 'name': string in the format "modname:entityname"
  5. 'mesh_name': string in the format "modname_meshFileName"
  6. 'texture_name': string in the format "modname_textureFileName"
  7. Example usage: minetest.register_entity(hot_air_balloons.get_entity(foo, raa, see))
  8. you can also store the values in a local variable and change the fields of the entity definition table before registering the entity.
  9. passing the entity name to the function is used when a balloon pilot logs off
  10. hot_air_balloons.get_item(name, description, texture, object_name)
  11. arguments:
  12. 'name': string in the format "modname:itemname"
  13. 'description': string that appears in the tooltip. Use minetest.translate with this.
  14. 'texture': string in the format "modname_textureFileName"
  15. 'object_name' is the name specified in hot_air_balloons.get_entity
  16. Example usage: minetest.register_craftitem(hot_air_balloons.get_item(foo, raa, see, mon))
  17. returns an item name and an item definition table
  18. as with get_entity you can store the item definition table and change its fields before registering the item.
  19. explanation of the custom fields of the entitiy definition table:
  20. pilot: stores the player name of the pilot or nil if there is no pilot
  21. heat: integer in the interval [0, 12000)
  22. Decides wether to fly up or down
  23. balloon_type: entity name of the balloon, e.g."hot_air_balloons:balloon".
  24. used to make the balloon log off and log back in together with its pilot