Calling a lua event from a .json item definition.
Like for example:
when you use item "gift" the event itemused.gift is called
Code: Select all
if event="itemused.gift" then
i=math.random(1,3)
if i==1 then
game.getplayer().insert{name="iron-plate", count=8}
elseif i==2 then
game.getplayer().insert{name="inserter", count=4}
elseif i==3 then
game.getplayer().insert{name="alien-artifact", count=2}
end
end
rotation of an entity (alredy said to kovarex)
a function to get the cords of all the entitys with that name in the game (alredy sugested to kovarex)
with those three we can create for example a wood farm, that drops wood like the drill, but with wood, and things like that