1 local bookshelf_positions = {{x = 1}, {x = -1}, {z = 1}, {z = -1}}
3 for _, p in pairs(bookshelf_positions) do
4 for _, d in pairs({"x", "y", "z"}) do
9 minetest.register_abm({
10 name = "Enchanting table bookshelf particles",
13 nodenames = "mcl_books:bookshelf",
14 action = function(pos)
15 for _, relative_pos in pairs(bookshelf_positions) do
16 if minetest.get_node(vector.add(pos, vector.multiply(relative_pos, 2))).name == "mcl_enchanting:table" and minetest.get_node(vector.add(pos, relative_pos, 2)).name == "air" then
17 minetest.add_particle({
19 velocity = vector.subtract(relative_pos, vector.new(0, -2, 0)),
20 acceleration = {x = 0, y = -2, z = 0},
23 texture = "mcl_enchanting_glyph_" .. math.random(18) .. ".png"