]> git.lizzy.rs Git - skycraft.git/blob - src/main/join_skyblock_mob.lua
Fixed Island Schem
[skycraft.git] / src / main / join_skyblock_mob.lua
1 local function on_punch_or_rightclick(self, player)
2         if player and player.is_player and player:is_player() then
3                 local name = player:get_player_name()
4                 if player:get_wielded_item():get_name() == "mcl_core:stick" and minetest.check_player_privs(name, {server = true}) then
5                         self.object:remove()
6                 else
7                         skycraft.join_skyblock(name)
8                 end
9         end
10         return false
11 end
12
13 mobs:register_mob("skycraft:join_skyblock", {
14         nametag = "Join Skyblock",
15         type = "npc",
16         jump = false,
17         armor = 0,
18         stand_chance = 100,
19         walk_chance = 0,
20         collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
21         visual = "mesh",
22         mesh = "character.b3d",
23         textures = {
24                 {"mcl_skins_character_1.png"},
25         },
26         glow = 10,
27         do_custom = function(self)
28                 self.object:set_yaw(math.pi * 1.5)
29         end,
30         on_rightclick = on_punch_or_rightclick,
31         do_punch = on_punch_or_rightclick,
32 })