Update helptext of obsidian
[MineClone/MineClone2.git] / mods / ITEMS / mcl_mobitems / init.lua
blob4e7eabc9eea80e20d4665d7455d8cc3f0f9fb278
1 local S = minetest.get_translator("mcl_mobitems")
3 minetest.register_craftitem("mcl_mobitems:rotten_flesh", {
4 description = S("Rotten Flesh"),
5 _tt_help = minetest.colorize("#FFFF00", S("80% chance of food poisoning")),
6 _doc_items_longdesc = S("Yuck! This piece of flesh clearly has seen better days. If you're really desperate, you can eat it to restore a few hunger points, but there's a 80% chance it causes food poisoning, which increases your hunger for a while."),
7 inventory_image = "mcl_mobitems_rotten_flesh.png",
8 wield_image = "mcl_mobitems_rotten_flesh.png",
9 on_place = minetest.item_eat(4),
10 on_secondary_use = minetest.item_eat(4),
11 groups = { food = 2, eatable = 4 },
12 _mcl_saturation = 0.8,
13 stack_max = 64,
16 minetest.register_craftitem("mcl_mobitems:mutton", {
17 description = S("Raw Mutton"),
18 _doc_items_longdesc = S("Raw mutton is the flesh from a sheep and can be eaten safely. Cooking it will greatly increase its nutritional value."),
19 inventory_image = "mcl_mobitems_mutton_raw.png",
20 wield_image = "mcl_mobitems_mutton_raw.png",
21 on_place = minetest.item_eat(2),
22 on_secondary_use = minetest.item_eat(2),
23 groups = { food = 2, eatable = 2 },
24 _mcl_saturation = 1.2,
25 stack_max = 64,
28 minetest.register_craftitem("mcl_mobitems:cooked_mutton", {
29 description = S("Cooked Mutton"),
30 _doc_items_longdesc = S("Cooked mutton is the cooked flesh from a sheep and is used as food."),
31 inventory_image = "mcl_mobitems_mutton_cooked.png",
32 wield_image = "mcl_mobitems_mutton_cooked.png",
33 on_place = minetest.item_eat(6),
34 on_secondary_use = minetest.item_eat(6),
35 groups = { food = 2, eatable = 6 },
36 _mcl_saturation = 9.6,
37 stack_max = 64,
40 minetest.register_craftitem("mcl_mobitems:beef", {
41 description = S("Raw Beef"),
42 _doc_items_longdesc = S("Raw beef is the flesh from cows and can be eaten safely. Cooking it will greatly increase its nutritional value."),
43 inventory_image = "mcl_mobitems_beef_raw.png",
44 wield_image = "mcl_mobitems_beef_raw.png",
45 on_place = minetest.item_eat(3),
46 on_secondary_use = minetest.item_eat(3),
47 groups = { food = 2, eatable = 3 },
48 _mcl_saturation = 1.8,
49 stack_max = 64,
52 minetest.register_craftitem("mcl_mobitems:cooked_beef", {
53 description = S("Steak"),
54 _doc_items_longdesc = S("Steak is cooked beef from cows and can be eaten."),
55 inventory_image = "mcl_mobitems_beef_cooked.png",
56 wield_image = "mcl_mobitems_beef_cooked.png",
57 on_place = minetest.item_eat(8),
58 on_secondary_use = minetest.item_eat(8),
59 groups = { food = 2, eatable = 8 },
60 _mcl_saturation = 12.8,
61 stack_max = 64,
64 minetest.register_craftitem("mcl_mobitems:chicken", {
65 description = S("Raw Chicken"),
66 _tt_help = minetest.colorize("#FFFF00", S("30% chance of food poisoning")),
67 _doc_items_longdesc = S("Raw chicken is a food item which is not safe to consume. You can eat it to restore a few hunger points, but there's a 30% chance to suffer from food poisoning, which increases your hunger rate for a while. Cooking raw chicken will make it safe to eat and increases its nutritional value."),
68 inventory_image = "mcl_mobitems_chicken_raw.png",
69 wield_image = "mcl_mobitems_chicken_raw.png",
70 on_place = minetest.item_eat(2),
71 on_secondary_use = minetest.item_eat(2),
72 groups = { food = 2, eatable = 2 },
73 _mcl_saturation = 1.2,
74 stack_max = 64,
77 minetest.register_craftitem("mcl_mobitems:cooked_chicken", {
78 description = S("Cooked Chicken"),
79 _doc_items_longdesc = S("A cooked chicken is a healthy food item which can be eaten."),
80 inventory_image = "mcl_mobitems_chicken_cooked.png",
81 wield_image = "mcl_mobitems_chicken_cooked.png",
82 on_place = minetest.item_eat(6),
83 on_secondary_use = minetest.item_eat(6),
84 groups = { food = 2, eatable = 6 },
85 _mcl_saturation = 7.2,
86 stack_max = 64,
89 minetest.register_craftitem("mcl_mobitems:porkchop", {
90 description = S("Raw Porkchop"),
91 _doc_items_longdesc = S("A raw porkchop is the flesh from a pig and can be eaten safely. Cooking it will greatly increase its nutritional value."),
92 inventory_image = "mcl_mobitems_porkchop_raw.png",
93 wield_image = "mcl_mobitems_porkchop_raw.png",
94 on_place = minetest.item_eat(3),
95 on_secondary_use = minetest.item_eat(3),
96 groups = { food = 2, eatable = 3 },
97 _mcl_saturation = 1.8,
98 stack_max = 64,
101 minetest.register_craftitem("mcl_mobitems:cooked_porkchop", {
102 description = S("Cooked Porkchop"),
103 _doc_items_longdesc = S("Cooked porkchop is the cooked flesh of a pig and is used as food."),
104 inventory_image = "mcl_mobitems_porkchop_cooked.png",
105 wield_image = "mcl_mobitems_porkchop_cooked.png",
106 on_place = minetest.item_eat(8),
107 on_secondary_use = minetest.item_eat(8),
108 groups = { food = 2, eatable = 8 },
109 _mcl_saturation = 12.8,
110 stack_max = 64,
113 minetest.register_craftitem("mcl_mobitems:rabbit", {
114 description = S("Raw Rabbit"),
115 _doc_items_longdesc = S("Raw rabbit is a food item from a dead rabbit. It can be eaten safely. Cooking it will increase its nutritional value."),
116 inventory_image = "mcl_mobitems_rabbit_raw.png",
117 wield_image = "mcl_mobitems_rabbit_raw.png",
118 on_place = minetest.item_eat(3),
119 on_secondary_use = minetest.item_eat(3),
120 groups = { food = 2, eatable = 3 },
121 _mcl_saturation = 1.8,
122 stack_max = 64,
125 minetest.register_craftitem("mcl_mobitems:cooked_rabbit", {
126 description = S("Cooked Rabbit"),
127 _doc_items_longdesc = S("This is a food item which can be eaten."),
128 inventory_image = "mcl_mobitems_rabbit_cooked.png",
129 wield_image = "mcl_mobitems_rabbit_cooked.png",
130 on_place = minetest.item_eat(5),
131 on_secondary_use = minetest.item_eat(5),
132 groups = { food = 2, eatable = 5 },
133 _mcl_saturation = 6.0,
134 stack_max = 64,
137 -- Reset food poisoning and status effects
138 local drink_milk = function(itemstack, player, pointed_thing)
139 local bucket = minetest.do_item_eat(0, "mcl_buckets:bucket_empty", itemstack, player, pointed_thing)
140 -- Check if we were allowed to drink this (eat delay check)
141 if mcl_hunger.active and (bucket:get_name() ~= "mcl_mobitems:milk_bucket" or minetest.is_creative_enabled(player:get_player_name())) then
142 mcl_hunger.stop_poison(player)
144 mcl_potions._reset_player_effects(player)
145 return bucket
148 minetest.register_craftitem("mcl_mobitems:milk_bucket", {
149 description = S("Milk"),
150 _tt_help = minetest.colorize("#00FF00", S("Removes all status effects")),
151 _doc_items_longdesc = S("Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will remove all status effects, but restores no hunger points."),
152 _doc_items_usagehelp = S("Use the placement key to drink the milk."),
153 inventory_image = "mcl_mobitems_bucket_milk.png",
154 wield_image = "mcl_mobitems_bucket_milk.png",
155 on_place = drink_milk,
156 on_secondary_use = drink_milk,
157 stack_max = 1,
158 groups = { food = 3, can_eat_when_full = 1 },
161 minetest.register_craftitem("mcl_mobitems:spider_eye", {
162 description = S("Spider Eye"),
163 _tt_help = minetest.colorize("#FFFF00", S("Poisonous")),
164 _doc_items_longdesc = S("Spider eyes are used mainly in crafting. If you're really desperate, you can eat a spider eye, but it will poison you briefly."),
165 inventory_image = "mcl_mobitems_spider_eye.png",
166 wield_image = "mcl_mobitems_spider_eye.png",
167 on_place = minetest.item_eat(2),
168 on_secondary_use = minetest.item_eat(2),
169 groups = { food = 2, eatable = 2, brewitem = 1 },
170 _mcl_saturation = 3.2,
171 stack_max = 64,
174 minetest.register_craftitem("mcl_mobitems:bone", {
175 description = S("Bone"),
176 _doc_items_longdesc = S("Bones can be used to tame wolves so they will protect you. They are also useful as a crafting ingredient."),
177 _doc_items_usagehelp = S("Wield the bone near wolves to attract them. Use the “Place” key on the wolf to give it a bone and tame it. You can then give commands to the tamed wolf by using the “Place” key on it."),
178 inventory_image = "mcl_mobitems_bone.png",
179 stack_max = 64,
180 groups = { craftitem=1 },
183 minetest.register_craftitem("mcl_mobitems:string",{
184 description = S("String"),
185 _doc_items_longdesc = S("Strings are used in crafting."),
186 inventory_image = "mcl_mobitems_string.png",
187 stack_max = 64,
188 groups = { craftitem = 1 },
191 minetest.register_craftitem("mcl_mobitems:blaze_rod", {
192 description = S("Blaze Rod"),
193 _doc_items_longdesc = S("This is a crafting component dropped from dead blazes."),
194 wield_image = "mcl_mobitems_blaze_rod.png",
195 inventory_image = "mcl_mobitems_blaze_rod.png",
196 groups = { craftitem = 1 },
197 stack_max = 64,
200 minetest.register_craftitem("mcl_mobitems:blaze_powder", {
201 description = S("Blaze Powder"),
202 _doc_items_longdesc = S("This item is mainly used for crafting."),
203 wield_image = "mcl_mobitems_blaze_powder.png",
204 inventory_image = "mcl_mobitems_blaze_powder.png",
205 groups = { craftitem = 1, brewitem = 1 },
206 stack_max = 64,
209 minetest.register_craftitem("mcl_mobitems:magma_cream", {
210 description = S("Magma Cream"),
211 _doc_items_longdesc = S("Magma cream is a crafting component."),
212 wield_image = "mcl_mobitems_magma_cream.png",
213 inventory_image = "mcl_mobitems_magma_cream.png",
214 groups = { craftitem = 1, brewitem = 1 },
215 stack_max = 64,
218 minetest.register_craftitem("mcl_mobitems:ghast_tear", {
219 description = S("Ghast Tear"),
220 _doc_items_longdesc = S("Place this item in an item frame as decoration."),
221 wield_image = "mcl_mobitems_ghast_tear.png",
222 inventory_image = "mcl_mobitems_ghast_tear.png",
223 groups = { brewitem = 1 },
224 stack_max = 64,
227 minetest.register_craftitem("mcl_mobitems:nether_star", {
228 description = S("Nether Star"),
229 _doc_items_longdesc = S("A nether star is dropped when the Wither dies. Place it in an item frame to show the world how hardcore you are! Or just as decoration."),
230 wield_image = "mcl_mobitems_nether_star.png",
231 inventory_image = "mcl_mobitems_nether_star.png",
232 -- TODO: Reveal item when it's useful
233 groups = { craftitem = 1, not_in_creative_inventory = 1 },
234 stack_max = 64,
237 minetest.register_craftitem("mcl_mobitems:leather", {
238 description = S("Leather"),
239 _doc_items_longdesc = S("Leather is a versatile crafting component."),
240 wield_image = "mcl_mobitems_leather.png",
241 inventory_image = "mcl_mobitems_leather.png",
242 groups = { craftitem = 1 },
243 stack_max = 64,
246 minetest.register_craftitem("mcl_mobitems:feather", {
247 description = S("Feather"),
248 _doc_items_longdesc = S("Feathers are used in crafting and are dropped from chickens."),
249 wield_image = "mcl_mobitems_feather.png",
250 inventory_image = "mcl_mobitems_feather.png",
251 groups = { craftitem = 1 },
252 stack_max = 64,
255 minetest.register_craftitem("mcl_mobitems:rabbit_hide", {
256 description = S("Rabbit Hide"),
257 _doc_items_longdesc = S("Rabbit hide is used to create leather."),
258 wield_image = "mcl_mobitems_rabbit_hide.png",
259 inventory_image = "mcl_mobitems_rabbit_hide.png",
260 groups = { craftitem = 1 },
261 stack_max = 64,
264 minetest.register_craftitem("mcl_mobitems:rabbit_foot", {
265 description = S("Rabbit's Foot"),
266 _doc_items_longdesc = S("Must be your lucky day! Place this item in an item frame for decoration."),
267 wield_image = "mcl_mobitems_rabbit_foot.png",
268 inventory_image = "mcl_mobitems_rabbit_foot.png",
269 groups = { brewitem = 1 },
270 stack_max = 64,
273 minetest.register_craftitem("mcl_mobitems:saddle", {
274 description = S("Saddle"),
275 _tt_help = S("Can be placed on animals to ride them"),
276 _doc_items_longdesc = S("Saddles can be put on some animals in order to mount them."),
277 _doc_items_usagehelp = S("Use the placement key with the saddle in your hand to try to put on the saddle. Saddles fit on horses, mules, donkeys and pigs. Horses, mules and donkeys need to be tamed first, otherwise they'll reject the saddle. Saddled animals can be mounted by using the placement key on them again."),
278 wield_image = "mcl_mobitems_saddle.png",
279 inventory_image = "mcl_mobitems_saddle.png",
280 groups = { transport = 1 },
281 stack_max = 1,
284 minetest.register_craftitem("mcl_mobitems:rabbit_stew", {
285 description = S("Rabbit Stew"),
286 _doc_items_longdesc = S("Rabbit stew is a very nutricious food item."),
287 wield_image = "mcl_mobitems_rabbit_stew.png",
288 inventory_image = "mcl_mobitems_rabbit_stew.png",
289 stack_max = 1,
290 on_place = minetest.item_eat(10, "mcl_core:bowl"),
291 on_secondary_use = minetest.item_eat(10, "mcl_core:bowl"),
292 groups = { food = 3, eatable = 10 },
293 _mcl_saturation = 12.0,
296 minetest.register_craftitem("mcl_mobitems:shulker_shell", {
297 description = S("Shulker Shell"),
298 _doc_items_longdesc = S("Shulker shells are used in crafting. They are dropped from dead shulkers."),
299 inventory_image = "mcl_mobitems_shulker_shell.png",
300 groups = { craftitem = 1 },
303 minetest.register_craftitem("mcl_mobitems:slimeball", {
304 description = S("Slimeball"),
305 _doc_items_longdesc = S("Slimeballs are used in crafting. They are dropped from slimes."),
306 inventory_image = "mcl_mobitems_slimeball.png",
307 groups = { craftitem = 1 },
310 minetest.register_craftitem("mcl_mobitems:gunpowder", {
311 description = S("Gunpowder"),
312 _doc_items_longdesc = doc.sub.items.temp.craftitem,
313 inventory_image = "default_gunpowder.png",
314 stack_max = 64,
315 groups = { craftitem=1, brewitem = 1 },
318 minetest.register_tool("mcl_mobitems:carrot_on_a_stick", {
319 description = S("Carrot on a Stick"),
320 _tt_help = S("Lets you ride a saddled pig"),
321 _doc_items_longdesc = S("A carrot on a stick can be used on saddled pigs to ride them."),
322 _doc_items_usagehelp = S("Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick."),
323 wield_image = "mcl_mobitems_carrot_on_a_stick.png",
324 inventory_image = "mcl_mobitems_carrot_on_a_stick.png",
325 groups = { transport = 1 },
329 -----------
330 -- Crafting
331 -----------
333 minetest.register_craft({
334 output = "mcl_mobitems:leather",
335 recipe = {
336 { "mcl_mobitems:rabbit_hide", "mcl_mobitems:rabbit_hide" },
337 { "mcl_mobitems:rabbit_hide", "mcl_mobitems:rabbit_hide" },
341 minetest.register_craft({
342 output = "mcl_mobitems:blaze_powder 2",
343 recipe = {{"mcl_mobitems:blaze_rod"}},
346 minetest.register_craft({
347 output = "mcl_mobitems:rabbit_stew",
348 recipe = {
349 { "", "mcl_mobitems:cooked_rabbit", "", },
350 { "group:mushroom", "mcl_farming:potato_item_baked", "mcl_farming:carrot_item", },
351 { "", "mcl_core:bowl", "", },
355 minetest.register_craft({
356 output = "mcl_mobitems:rabbit_stew",
357 recipe = {
358 { "", "mcl_mobitems:cooked_rabbit", "", },
359 { "mcl_farming:carrot_item", "mcl_farming:potato_item_baked", "group:mushroom", },
360 { "", "mcl_core:bowl", "", },
364 minetest.register_craft({
365 output = "mcl_mobitems:carrot_on_a_stick",
366 recipe = {
367 { "mcl_fishing:fishing_rod", "", },
368 { "", "mcl_farming:carrot_item" },
372 minetest.register_craft({
373 output = "mcl_mobitems:carrot_on_a_stick",
374 recipe = {
375 { "", "mcl_fishing:fishing_rod", },
376 { "mcl_farming:carrot_item", "" },
380 minetest.register_craft({
381 type = "shapeless",
382 output = "mcl_mobitems:magma_cream",
383 recipe = {"mcl_mobitems:blaze_powder", "mcl_mobitems:slimeball"},
386 minetest.register_craft({
387 type = "cooking",
388 output = "mcl_mobitems:cooked_mutton",
389 recipe = "mcl_mobitems:mutton",
390 cooktime = 10,
393 minetest.register_craft({
394 type = "cooking",
395 output = "mcl_mobitems:cooked_rabbit",
396 recipe = "mcl_mobitems:rabbit",
397 cooktime = 10,
400 minetest.register_craft({
401 type = "cooking",
402 output = "mcl_mobitems:cooked_chicken",
403 recipe = "mcl_mobitems:chicken",
404 cooktime = 10,
407 minetest.register_craft({
408 type = "cooking",
409 output = "mcl_mobitems:cooked_beef",
410 recipe = "mcl_mobitems:beef",
411 cooktime = 10,
414 minetest.register_craft({
415 type = "cooking",
416 output = "mcl_mobitems:cooked_porkchop",
417 recipe = "mcl_mobitems:porkchop",
418 cooktime = 10,
421 minetest.register_craft({
422 type = "fuel",
423 recipe = "mcl_mobitems:blaze_rod",
424 burntime = 120,
427 minetest.register_craft({
428 output = 'mcl_mobitems:slimeball 9',
429 recipe = {{"mcl_core:slimeblock"}},
432 minetest.register_craft({
433 output = "mcl_core:slimeblock",
434 recipe = {{"mcl_mobitems:slimeball","mcl_mobitems:slimeball","mcl_mobitems:slimeball",},
435 {"mcl_mobitems:slimeball","mcl_mobitems:slimeball","mcl_mobitems:slimeball",},
436 {"mcl_mobitems:slimeball","mcl_mobitems:slimeball","mcl_mobitems:slimeball",}},
439 minetest.register_on_item_eat(function (hp_change, replace_with_item, itemstack, user, pointed_thing)
441 -- poisoning with spider eye
442 if itemstack:get_name() == "mcl_mobitems:spider_eye" then
443 mcl_potions.poison_func(user, 1, 4)
446 end )