Hello there. I am needing some help with formspecs.
I can't seem to find a tutorial on them anywhere, and I can't seem to understand it by looking at other's code. Could someone please give me a quick overview of them or something similar?
Thanks!
MarkSill wrote:Yeah, I looked at that, but where would it go in the code?
PilzAdam wrote:MarkSill wrote:Yeah, I looked at that, but where would it go in the code?
Depends what formspec you want to have. If you want a node to have a formspec that opens on a rightclick, then you have to set it in the metadata. Default chests do this in on_construct(): https://github.com/minetest/common/blob/master/mods/default/init.lua#L1774
When you want to change the player's formspec, then you would call player:set_inventory_formspec(param) in register_on_joinplayer() with the formspec string as param.
Users browsing this forum: No registered users and 8 guests