-
Notifications
You must be signed in to change notification settings - Fork 1
/
entity.lua
103 lines (92 loc) · 2.05 KB
/
entity.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
local S = core.get_translator(skeleton.modname)
local bones_sound, death_sound
if core.global_exists("sounds") then
if sounds.skeleton then
bones_sound = sounds.skeleton:get(1)
end
if sounds.zombie_death then
death_sound = sounds.zombie_death:get(1)
end
end
local mob_name = "skeleton:skeleton"
local base_def = {
name = mob_name,
nametag = S("Skeleton"),
hp_min = 55,
hp_max = 55,
hostile = true,
knockback = true,
sneaky = false,
floats = true,
stepheight = 1,
collisionbox = {-0.25, -0.01, -0.25, 0.25, 1.65, 0.25},
rotation = -90.0,
mesh = "creatures_zombie.b3d",
textures = {"skeleton_mesh.png"},
drops = {
{name="skeleton:bone", min=1, max=1, chance=1},
},
spawn = {
interval = skeleton.spawn_interval,
chance = skeleton.spawn_chance,
nodes = {
"group:sand",
"group:stone",
"nether:rack",
"nether:rack_deep",
},
light_range = {min=0, max=8},
height_range = {min=-31000, max=31000},
count = {min=1, max=2},
},
combat = {
radius = 2.0,
damage = 13,
chance = 100,
},
speed = {
walk = 1,
run = 3,
},
search = {
radius = 20,
target = "player",
},
mode_chance = {
idle = 0.3,
walk = 0.7,
},
sounds = {
random = bones_sound,
death = death_sound,
war_cry = nil,
attack = nil,
damage = nil,
},
animation = {
idle = {start=0, stop=80, speed=15},
walk = {start=102, stop=122, speed=15.5},
run = {},
attack = {start=102, stop=122, speed=25},
death = {start=81, stop=101, speed=28, loop=false, rotate=false, duration=2.12},
},
}
dofile(skeleton.modpath .. "/register/" .. skeleton.lib .. ".lua")(base_def)
if core.global_exists("asm") then
asm.addEgg({
name = "skeleton",
title = S("Skeleton"),
inventory_image = "skeleton_inv.png",
spawn = mob_name,
ingredients = "skeleton:bone",
})
end
-- use entity name for spawnegg alias
if not core.registered_items["skeleton:skeleton"] then
core.register_alias("skeleton:skeleton", "spawneggs:skeleton")
end
core.register_craftitem("skeleton:bone", {
description = S("Bone"),
inventory_image = "skeleton_bone.png",
stack_max = 99,
})