Make villager stand still if there is near player
[MineClone/MineClone2.git] / mods / ENTITIES / mobs_mc / guardian.lua
blob131487148141ac1fc3ed8db92366fc965669e672
1 -- v1.4
3 --###################
4 --################### GUARDIAN
5 --###################
7 -- intllib
8 local MP = minetest.get_modpath(minetest.get_current_modname())
9 local S, NS = dofile(MP.."/intllib.lua")
11 mobs:register_mob("mobs_mc:guardian", {
12 type = "monster",
13 hp_min = 30,
14 hp_max = 30,
15 passive = false,
16 attack_type = "dogfight",
17 pathfinding = 1,
18 view_range = 16,
19 walk_velocity = 2,
20 run_velocity = 4,
21 damage = 6,
22 reach = 3,
23 collisionbox = {-0.425, 0.25, -0.425, 0.425, 1.1, 0.425},
24 visual = "mesh",
25 mesh = "mobs_mc_guardian.b3d",
26 textures = {
27 {"mobs_mc_guardian.png"},
29 visual_size = {x=3, y=3},
30 sounds = {
31 damage = "mobs_mc_squid_hurt",
32 distance = 16,
34 animation = {
35 stand_speed = 25, walk_speed = 25, run_speed = 50,
36 stand_start = 0, stand_end = 20,
37 walk_start = 0, walk_end = 20,
38 run_start = 0, run_end = 20,
40 drops = {
41 {name = mobs_mc.items.prismarine_shard,
42 chance = 1,
43 min = 0,
44 max = 2,},
46 -- The following drops are approximations
47 -- Fish / prismarine crystal
48 {name = mobs_mc.items.fish_raw,
49 chance = 4,
50 min = 1,
51 max = 1,},
52 {name = mobs_mc.items.prismarine_crystals,
53 chance = 4,
54 min = 1,
55 max = 1,},
57 -- Rare drop: fish
58 {name = mobs_mc.items.fish_raw,
59 chance = 160, -- 2.5% / 4
60 min = 1,
61 max = 1,},
62 {name = mobs_mc.items.salmon_raw,
63 chance = 160,
64 min = 1,
65 max = 1,},
66 {name = mobs_mc.items.clownfish_raw,
67 chance = 160,
68 min = 1,
69 max = 1,},
70 {name = mobs_mc.items.pufferfish_raw,
71 chance = 160,
72 min = 1,
73 max = 1,},
75 fly = true,
76 fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source },
77 stepheight = 0.1,
78 jump = false,
79 view_range = 16,
80 water_damage = 0,
81 lava_damage = 4,
82 light_damage = 0,
83 blood_amount = 0,
86 mobs:spawn_specific("mobs_mc:guardian", mobs_mc.spawn.water, mobs_mc.spawn_water, 0, minetest.LIGHT_MAX+1, 30, 25000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.water - 10)
88 -- spawn eggs
89 mobs:register_egg("mobs_mc:guardian", S("Guardian"), "mobs_mc_spawn_icon_guardian.png", 0)