newfunc.lua 396 B

12345678910111213141516
  1. function throwing.entity_blocks_arrow(entity_name)
  2. -- Dropped itemstacks don't take damage.
  3. if entity_name == "__builtin:item" then
  4. return true
  5. end
  6. -- Ignore other arrows/fireballs in flight.
  7. local is_arrow = (string.find(entity_name, "arrow") or string.find(entity_name, "fireball"))
  8. if is_arrow then
  9. return true
  10. end
  11. -- Entity is unknown, so punch it for damage!
  12. return false
  13. end