Modding question

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

Modding question

by Extex » Post

How would I make a mod with a block that when you interact with it, it shows a formspec and removes the node, but when the player closes the formspec the node re-appears
Code snippet would be appreciated
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: Modding question

by duane » Post

Extex wrote:How would I make a mod with a block that when you interact with it, it shows a formspec and removes the node, but when the player closes the formspec the node re-appears
Code snippet would be appreciated
The first part is easy. Just look at chests.lua and replace with air instead of another chest node. Putting the node back could be a problem. I'm not sure if on_receive_fields gets called in every case of a formspec closing. What if the player disconnects with the formspec open?
Believe in people and you don't need to believe anything else.

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

Re: Modding question

by Extex » Post

Oh I didn't think of that!
Thanks!
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests