How do I place a block with lua

OmniStudent
Member
 
Posts: 261
Joined: Sat Nov 03, 2012 06:40

How do I place a block with lua

by OmniStudent » Thu Nov 22, 2012 12:19

I need a simple lua script that places a block of a certain type in a certain position.

Could anyone tell me how to do this please?
 

jin_xi
Member
 
Posts: 165
Joined: Mon Jul 02, 2012 18:19

by jin_xi » Thu Nov 22, 2012 12:33

 

OmniStudent
Member
 
Posts: 261
Joined: Sat Nov 03, 2012 06:40

by OmniStudent » Thu Nov 22, 2012 13:11

Thankyou, good document.
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Thu Nov 22, 2012 13:28

To be specific, you want the add_node() function.

Unless you're replacing a specific material, always check for the presence of air in the location where your new node is being placed (to avoid "content ignore" warnings and wasted materials).

Also, if you're adding a node in response to a player action (as opposed to just spawning randomly inside an ABM or map generator hook), be sure to check for the presence of node_ownership and glomie's protection mod, and heed any warnings those give. This prevents others using your mod to grief a server that runs your mod and those.
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 6 guests

cron