lbm.lua 934 B

123456789101112131415161718192021222324
  1. ---@meta
  2. ---LBM (LoadingBlockModifier) definition
  3. ----------------------------------------
  4. -- Used by `minetest.register_lbm`.
  5. --
  6. -- A loading block modifier (LBM) is used to define a function that is called for
  7. -- specific nodes (defined by `nodenames`) when a mapblock which contains such nodes
  8. -- gets activated (not loaded!).
  9. ---@class mt.LBMDef
  10. -- Descriptive label for profiling purposes (optional).
  11. -- Definitions with identical labels will be listed as one.
  12. ---@field label string|nil
  13. ---@field name string
  14. -- * List of node names to trigger the LBM on.
  15. -- * Also non-registered nodes will work.
  16. -- * Groups (as of group:groupname) will work as well.
  17. ---@field nodenames string[]
  18. -- Whether to run the LBM's action every time a block gets activated,
  19. -- and not only the first time the block gets activated after the LBM
  20. -- was introduced.
  21. ---@field run_at_every_load boolean
  22. ---@field action fun(pos:mt.Vector, node:mt.Node)