2015-09-21 12:55:29 +02:00
|
|
|
|
|
|
|
Lucky Block API
|
|
|
|
===============
|
|
|
|
|
|
|
|
Please make sure that lucky_block appears in the depends.txt file of your mod.
|
|
|
|
|
|
|
|
|
|
|
|
USAGE: (check blocks.lua for many examples)
|
|
|
|
|
|
|
|
lucky_block:add_block({line})
|
|
|
|
|
|
|
|
|
|
|
|
LINE COMMANDS:
|
|
|
|
|
|
|
|
|
|
|
|
-= Place Node
|
|
|
|
|
|
|
|
{"nod", "node name", position, chest items}
|
|
|
|
|
|
|
|
e.g.
|
|
|
|
|
|
|
|
Replace Lucky Block with Dirt Block
|
|
|
|
{"nod", "default:dirt", 0}
|
|
|
|
|
|
|
|
Place Fire at player position
|
|
|
|
{"nod", "fire:basic_flame", 1}
|
|
|
|
|
|
|
|
Replace Lucky Block with chest containing random items from default list
|
|
|
|
{"nod", "default:chest", 0}
|
|
|
|
|
|
|
|
Replace Lucky Block with chest containing random items PLUS a few extra
|
|
|
|
{"nod", "default:chest", 0, {{name="flowers:rose", max=5}, {name="default:goldblock", max=2}}}
|
|
|
|
|
|
|
|
|
|
|
|
-= Drop Item(s)
|
|
|
|
|
|
|
|
{"dro", {"item names"}, number to drop, random colour}
|
|
|
|
|
|
|
|
e.g.
|
|
|
|
|
|
|
|
Drop 5x Torches
|
|
|
|
{"dro", {"default:torch"}, 5}
|
|
|
|
|
|
|
|
Drop 10x randomly Coloured Wool (colour name added to end of item string)
|
|
|
|
{"dro", {"wool:"}, 10, true}
|
|
|
|
|
|
|
|
Drop 5x random Tools from list
|
|
|
|
{"dro", {"default:pick_mese", "default:shovel_steel", "default:axe_diamond"}, 5}
|
|
|
|
|
|
|
|
|
2015-12-11 14:00:53 +01:00
|
|
|
-= Place Schematic
|
|
|
|
|
|
|
|
Add schematic file to main list before adding lucky block:
|
|
|
|
|
|
|
|
lucky_block:add_schematics({
|
|
|
|
{"name", schematic filename or definition, {offset}},
|
|
|
|
end
|
|
|
|
|
|
|
|
e.g.
|
|
|
|
|
|
|
|
lucky_block:add_schematics({
|
|
|
|
{"platform", platform, {x = 2, y = 0, z = 2}},
|
|
|
|
})
|
|
|
|
|
|
|
|
then you can add the lucky block containing the schematic:
|
2015-09-21 12:55:29 +02:00
|
|
|
|
2015-12-11 13:48:18 +01:00
|
|
|
{"sch", "schematic name", position, force placement}
|
2015-09-21 12:55:29 +02:00
|
|
|
|
|
|
|
e.g.
|
|
|
|
|
2015-12-11 13:48:18 +01:00
|
|
|
Remove lucky block and build lucky platform in it's place
|
|
|
|
{"sch", "platform", 0, true}
|
2015-09-21 12:55:29 +02:00
|
|
|
|
2015-12-11 13:48:18 +01:00
|
|
|
Place apple tree at player position
|
|
|
|
{"sch", "appletree", 1, false}
|
2015-09-21 12:55:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
-= Spawn Entity(s)
|
|
|
|
|
2015-12-11 12:08:57 +01:00
|
|
|
{"spw", "entity name", number to spawn, tamed, owned, range}
|
2015-09-21 12:55:29 +02:00
|
|
|
|
|
|
|
e.g.
|
|
|
|
|
2015-12-11 12:08:57 +01:00
|
|
|
Spawn 2x Dirt Monsters over a radius of 10 blocks
|
|
|
|
{"spw", "mobs:dirt_monster", 2, nil, nil, 10}
|
2015-09-21 12:55:29 +02:00
|
|
|
|
|
|
|
Spawn 5x randomly coloured Sheep (random colour only works with sheep)
|
|
|
|
{"spw", "mobs:sheep", 5}
|
|
|
|
|
|
|
|
Spawn NPC who is tamed and owned by player
|
|
|
|
{"spw", "mobs:npc", 1, true, true}
|
|
|
|
|
|
|
|
|
|
|
|
-= Falling Blocks
|
|
|
|
|
2015-12-11 12:08:57 +01:00
|
|
|
{"fal", {node list}, position, spread, range}
|
2015-09-21 12:55:29 +02:00
|
|
|
|
|
|
|
e.g.
|
|
|
|
|
2015-12-11 12:08:57 +01:00
|
|
|
Drop 2x Sand and 1x Gold Block and spread over range of 5 blocks
|
2015-09-21 12:55:29 +02:00
|
|
|
|
2015-12-11 12:08:57 +01:00
|
|
|
{"fal", {"default:sand", "default:sand", "default:goldblock"}, 0, true, 5}
|
2015-09-21 12:55:29 +02:00
|
|
|
|
|
|
|
Drop 2x Obsidian onto player
|
|
|
|
{"fal", {"default:obsidian", "default:obsidian"}, 1}
|
|
|
|
|
|
|
|
|
|
|
|
-= Troll Block
|
|
|
|
|
|
|
|
{"tro", "node name", "sound", explosion},
|
|
|
|
|
|
|
|
e.g.
|
|
|
|
|
|
|
|
Add diamond block then after 2 seconds remove with explosion
|
|
|
|
|
|
|
|
{"tro", "default:diamondblock", nil, true}
|
|
|
|
|
|
|
|
Add gold block with wood sound, then after 2 seconds remove with pop
|
|
|
|
|
|
|
|
{"tro", "default:goldblock", "default_wood_footstep", nil}
|
|
|
|
|
|
|
|
|
|
|
|
-= Explosion (no settings, Lucky Block explodes and deals damage to all nearby)
|
|
|
|
|
|
|
|
{"exp"}
|
|
|
|
|
|
|
|
|
|
|
|
-= Teleport (no settings, player teleports +/- 10 blocks in any direction)
|
|
|
|
|
2015-12-11 12:08:57 +01:00
|
|
|
{"tel", horizontal range, vertical range}
|
2015-09-21 12:55:29 +02:00
|
|
|
|
2015-12-11 12:08:57 +01:00
|
|
|
e.g.
|
|
|
|
|
|
|
|
Teleport player to random position 10 blocks left/right and 5 blocks up/under
|
|
|
|
|
|
|
|
{"tel", 10, 5}
|
|
|
|
|
|
|
|
|
|
|
|
-= Lightning Strike (Player is hit by lightning and deals damage with fire)
|
|
|
|
|
|
|
|
{"lig", "fire node"}
|
|
|
|
|
|
|
|
e.g.
|
|
|
|
|
|
|
|
Lightning strike with temporary fire
|
|
|
|
|
|
|
|
{"lig", "fire:basic_flame"}
|
2015-09-21 12:55:29 +02:00
|
|
|
|
2015-12-11 12:08:57 +01:00
|
|
|
Lightning strike with permanent fire
|
2015-09-21 12:55:29 +02:00
|
|
|
|
2015-12-11 12:08:57 +01:00
|
|
|
{"lig", "fire:permanent_flame"}
|
2015-09-30 12:19:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
Additional Commands thanks to blert2112
|
|
|
|
|
|
|
|
lucky_block:purge_block_list()
|
|
|
|
|
|
|
|
This removes all pre-defined lucky blocks and leaves the super lucky block.
|
|
|
|
|
|
|
|
|
|
|
|
lucky_block:purge_chest_items()
|
|
|
|
|
|
|
|
This removes all pre-defined chest_stuff items and leaves it empty.
|
|
|
|
|
|
|
|
|
|
|
|
lucky_block:add_chest_items(list)
|
|
|
|
|
|
|
|
This command adds items to the chest_stuff list for use inside of lucky chests:
|
|
|
|
|
|
|
|
lucky_block:add_chest_items({
|
|
|
|
{name = "default:apple", max = 3},
|
|
|
|
{name = "default:steel_ingot", max = 2},
|
|
|
|
{name = "default:gold_ingot", max = 2},
|
|
|
|
{name = "default:diamond", max = 1},
|
|
|
|
{name = "default:pick_steel", max = 1}
|
|
|
|
})
|
2015-12-11 13:48:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
lucky_block:add_schematics({line})
|
|
|
|
|
|
|
|
This adds a schematic to the main list before adding the actual lucky block
|
|
|
|
that contains the schematic reference name (see schems.lua for examples).
|