]> git.lizzy.rs Git - skycraft.git/commitdiff
Added Join Skyblock Mob
authorElias Fleckenstein <eliasfleckenstein@web.de>
Wed, 10 Jun 2020 08:54:50 +0000 (10:54 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Wed, 10 Jun 2020 08:54:50 +0000 (10:54 +0200)
modules.txt
src/main/join_skyblock_mob.lua [new file with mode: 0644]

index 3a5eaeab6615d9366d74a7271444036aefffdda9..f7d313367dd85bd200c2d7c29b705ea41bd02a18 100644 (file)
@@ -1 +1 @@
-return {common={"common","random","request","schems",},main={"commands","flower_spread","lobby","lucky_block","mapgen","money","netherrack_fix","plots","ranks","spawns","tpa","trade","wither_spawn",},onload={"lava_cooling","lobby_grass","monster_egg_stone_block","nether_portal","sapling_mutation","shop","spawn","void",},}
\ No newline at end of file
+return {common={"common","random","request","schems",},main={"commands","flower_spread","join_skyblock_mob","lobby","lucky_block","mapgen","money","netherrack_fix","plots","ranks","spawns","tpa","trade","wither_spawn",},onload={"lava_cooling","lobby_grass","monster_egg_stone_block","nether_portal","sapling_mutation","shop","spawn","void",},}
\ No newline at end of file
diff --git a/src/main/join_skyblock_mob.lua b/src/main/join_skyblock_mob.lua
new file mode 100644 (file)
index 0000000..2c47853
--- /dev/null
@@ -0,0 +1,32 @@
+local function on_punch_or_rightclick(self, player)
+       if player and player.is_player and player:is_player() then
+               local name = player:get_player_name()
+               if player:get_wielded_item():get_name() == "mcl_core:stick" and minetest.check_player_privs(name, {server = true}) then
+                       self.object:remove()
+               else
+                       skycraft.join_skyblock(name)
+               end
+       end
+       return false
+end
+
+mobs:register_mob("skycraft:join_skyblock", {
+       nametag = "Join Skyblock",
+       type = "npc",
+       jump = false,
+       armor = 0,
+       stand_chance = 100,
+       walk_chance = 0,
+       collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
+       visual = "mesh",
+       mesh = "character.b3d",
+       textures = {
+               {"mcl_skins_character_1.png"},
+       },
+       glow = 10,
+       do_custom = function(self)
+               self.object:set_yaw(math.pi * 1.5)
+       end,
+       on_rightclick = on_punch_or_rightclick,
+       do_punch = on_punch_or_rightclick,
+})