rat.lua 925 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. mobs:register_mob("mobs_flat:rat", {
  2. type = "animal",
  3. passive = true,
  4. attack_type = "dogfight",
  5. group_attack = true,
  6. pathfinding = true,
  7. reach = 0.5,
  8. damage = 1,
  9. hp_min = 1,
  10. hp_max = 4,
  11. armor = 200,
  12. collisionbox = {-0.4, -0.5, -0.4, 0.4, 0.2, 0.4},
  13. visual = "upright_sprite",
  14. drawtype = "side",
  15. textures = {
  16. "mobs_flat_rat.png",
  17. "mobs_flat_rat.png",
  18. },
  19. makes_footstep_sound = false,
  20. sounds = {
  21. random = "mobs_rat",
  22. },
  23. walk_velocity = 1,
  24. run_velocity = 2,
  25. jump = true,
  26. drops = {},
  27. water_damage = 1,
  28. lava_damage = 4,
  29. light_damage = 0,
  30. fear_height = 2,
  31. floats = 1,
  32. on_rightclick = function(self, clicker)
  33. mobs:capture_mob(self, clicker, 50, 90, 0, true, "mobs_flat:rat_caught")
  34. end,
  35. })
  36. mobs:spawn({
  37. name = "mobs_flat:rat",
  38. nodes = {"default:dirt_with_grass", "default:dirt"},
  39. chance = 70,
  40. active_object_count = 2
  41. })
  42. mobs:register_egg("mobs_flat:rat", "Rat", "default_gravel.png", 1)