aboutsummaryrefslogtreecommitdiff
path: root/src/main/join_skyblock_mob.lua
blob: 2c478534b2609d3587990f836c9423808e38ced2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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,
})