Modding question

Post Reply
User avatar
Extex
Member
Posts: 190
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
Player of PK, RIP. Creator of the light_tool and motorbike mods. Working on another mod which should be coming soon!

User avatar
duane
Member
Posts: 1641
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: 190
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!
Player of PK, RIP. Creator of the light_tool and motorbike mods. Working on another mod which should be coming soon!

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests