Difference between revisions of "Modding Intro"

From Minetest Developer Wiki
Jump to navigation Jump to search
(Redirected page to Modding Book)
Line 1: Line 1:
<big>'''This page is under construction. See the [[Intro]] or [http://rubenwardy.com/minetest_modding_book Minetest Modding Tutorial Book]'''</big>
+
#REDIRECT [[Modding_Book]]
 
 
{{ModdingIntro}}
 
 
 
== Intro ==
 
 
 
Minetest has a scripting [http://en.wikipedia.org/wiki/Application_programming_interface API] ('''A'''pplication '''P'''rogramming '''I'''nterface), which is used to program '''mods''' (short for "modifications") for the game, extending its features and adding new items.
 
 
 
This API is accessed using an easy-to-use programming language called Lua.
 
 
 
The only thing you will need is basic programming knowledge. If you don't have any programming experience, you can use http://codecademy.com to learn. It will teach you the basics of programming (it is JavaScript, not Lua, but still helps).
 
 
 
More specifically, the version of Lua is 5.1. [http://www.lua.org/manual/5.1/ Reference manual], [http://www.lua.org/pil/ book]
 
 
 
== Example ==
 
<source>
 
-- Add the decowood node
 
minetest.register_node("tutorial:decowood", {
 
tiles = {"tutorial_decowood.png"},
 
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
 
})
 
 
 
-- Add the decostick craftitem
 
minetest.register_craftitem("tutorial:decostick", {
 
inventory_image = "tutorial_decostick.png",
 
groups = {stick=1},
 
})
 
 
 
-- Add the crafting recipe for decowood
 
minetest.register_craft({
 
output = 'tutorial:decowood 2',
 
recipe = {
 
{'default:wood', 'default:wood', ''},
 
{'default:wood', 'default:wood', ''},
 
{'', '', ''},
 
}
 
})
 
 
 
-- Add the furnace recipe for decosticks
 
minetest.register_craft({
 
type = "cooking",
 
recipe = "tutorial:decowood",
 
output = "tutorial:decostick",
 
})
 
</source>
 
== Next ==
 
Learn how to actually set up an environment to start modding in the next section! [[Modding_Setup]]
 
[[Category:Mods]]
 

Revision as of 17:44, 1 June 2015

Redirect to: