[Mod] Christmas [1.0] [christmas]

Post Reply
User avatar
Extex
Member
Posts: 250
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

[Mod] Christmas [1.0] [christmas]

by Extex » Post

My Third mod!

Image

Christmas Mod

Sweet treats:
  • Candy Canes
  • Gingerbread man*
  • Eggnog*
  • Mince pie
  • Sugar* (To craft your sweets)
If you eat too many sweets you'll get a sugar rush.

Decorations:
  • Stocking (Get rewards every 15 minutes)
  • Goodie Bag* (Filled with decorations)
  • Star* (Tree Topper)
  • Christmas Angel† (To decorate your house/tree)
  • Christmas lights† (To decorate your house/tree)
  • Tinsel† (For your tree)
  • Ornaments† (For your tree)
  • Presents† (Give gifts to your friends)
  • Tree (The center of all decorations)
* Exclusive Stocking reward
† Exclusive Goodie Bag reward
Spoiler
  • Christmas crackers
  • Christmas wreath
  • Santa Costume (3d_armor)
  • Holly
  • Mistletoe
  • (Maybe) make it disable itself after Christmas season
License: Code (MIT), Textures (CC BY-SA 3.0)

Dependencies: xcompat

Optional dependencies: default, farming, wool, dye, areas, mcl_formspec, mesecons

Browse code: SOURCE

Download: Extex101/christmas... master.zip
Last edited by Extex on Sat Jan 10, 2026 20:35, edited 1 time in total.

User avatar
Nathan.S
Member
Posts: 1170
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
Contact:

Re: [Mod] Christmas [1.0] [christmas]

by Nathan.S » Post

Looks promising. You're missing recipes for a handful of items though.
I record Luanti videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Extex
Member
Posts: 250
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Christmas [1.0] [christmas]

by Extex » Post

Some items aren't craftable their only obtainable as a reward in the stocking

User avatar
Nathan.S
Member
Posts: 1170
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
Contact:

Re: [Mod] Christmas [1.0] [christmas]

by Nathan.S » Post

Does that include the sugar? because it's needed to crate a few things, but has no craft for itself.
I record Luanti videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Extex
Member
Posts: 250
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Christmas [1.0] [christmas]

by Extex » Post

Yes it's also a reward
Look at the end of init.lua

User avatar
Nathan.S
Member
Posts: 1170
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
Contact:

Re: [Mod] Christmas [1.0] [christmas]

by Nathan.S » Post

Okay, will check that out and see about recording a video today or tomorrow. :)
I record Luanti videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Nathan.S
Member
Posts: 1170
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
Contact:

Re: [Mod] Christmas [1.0] [christmas]

by Nathan.S » Post

Okay, this time I think I found an actual bug. I can right click on the stocking as much as I want after it's filled and I keep adding the items to my inventory. Also if my active item in the hotbar is the same as what is in the stocking it won't add anything, or if the hotbar slot is empty, it will not get filled. Looking at the code it doesn't look like the inventory of the stocking is ever cleared.
This code snippet seems to fix the problem. I don't know what the leftover locals were for, and removing them and calling playerinv:add_item seemed to work just fine.

Code: Select all

		elseif not inv:is_empty("main") then --stocking has something in it.
			local item1 = inv:get_stack("main", 1)
			local item2 = inv:get_stack("main", 2)
			local item3 = inv:get_stack("main", 3)
            playerinv:add_item("main", item1)
            playerinv:add_item("main", item2)
            playerinv:add_item("main", item3)
            inv:set_stack("main", 1 ,'')
            inv:set_stack("main", 2 ,'')
            inv:set_stack("main", 3 ,'')
			timer:start(5400)
This code doesn't check if the player inventory is full, but neither did the original. If the player inventory is full the items are lost and the clock is still restarted. There is a way to check if the items will fit in inventory, and if they don't they could either be dropped in world, or you could opt to not set the inventory empty. However if a player had two empty slots they could keep right clicking on the stocking and fill those two slots to 99 items because the stocking keeps giving items.
I record Luanti videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Extex
Member
Posts: 250
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Christmas [1.0] [christmas]

by Extex » Post

Oh...
I'll look into it

User avatar
Extex
Member
Posts: 250
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Christmas [1.0] [christmas]

by Extex » Post

Ok fixed.
Sorry for the long delay
Been busy...

mase
Member
Posts: 91
Joined: Tue Feb 21, 2017 20:16
In-game: mase

Re: [Mod] Christmas [1.0] [christmas]

by mase » Post

I get the message, that christmas_present_top.png is missing. It is not there indeed.

User avatar
Extex
Member
Posts: 250
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Christmas [1.0] [christmas]

by Extex » Post

Sorry for the very late reply but it's fixed now mase

User avatar
Lupercus
Member
Posts: 33
Joined: Tue Jan 03, 2017 02:08
GitHub: lupercus13
IRC: Lupercus-Server
In-game: Lupercus

Re: [Mod] Christmas [1.0] [christmas]

by Lupercus » Post

Hello, love the mod, but latest version on ContentDB throws this error when loaded on new map, minetest version 5.4.1
Attachments
Screenshot from 2021-09-17 20-22-14.png
Screenshot from 2021-09-17 20-22-14.png (94.33 KiB) Viewed 2536 times

User avatar
Slightly
Member
Posts: 143
Joined: Sun May 15, 2022 22:29
In-game: Slightly

Re: [Mod] Christmas [1.0] [christmas]

by Slightly » Post

Code: Select all

2025-12-16 15:28:38: ERROR[Main]: ModError: Failed to load and run script from D:\Luanti_5.14\mods\sc_decor_modpack\christmas\init.lua:
2025-12-16 15:28:38: ERROR[Main]: D:\Luanti_5.14\mods\sc_decor_modpack\christmas/tree.lua:184: attempt to call field 'register_mvps_stopper' (a nil value)
2025-12-16 15:28:38: ERROR[Main]: stack traceback:
2025-12-16 15:28:38: ERROR[Main]: 	D:\Luanti_5.14\mods\sc_decor_modpack\christmas/tree.lua:184: in main chunk
2025-12-16 15:28:38: ERROR[Main]: 	[C]: in function 'dofile'
2025-12-16 15:28:38: ERROR[Main]: 	D:\Luanti_5.14\mods\sc_decor_modpack\christmas\init.lua:50: in main chunk
2025-12-16 15:28:38: ERROR[Main]: Check debug.txt for details.
New version, if I have mesecons, etc but it happens to not be loaded yet, will throw this error. I had to make it a dependency to run it. Nice update, though. Thanks for sharing it.

User avatar
Extex
Member
Posts: 250
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Christmas [1.0] [christmas]

by Extex » Post

Slightly wrote:
Tue Dec 16, 2025 22:40
New version, if I have mesecons, etc but it happens to not be loaded yet, will throw this error. I had to make it a dependency to run it. Nice update, though. Thanks for sharing it.
Should be fixed in the newest update!

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests