diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-06-12 09:26:25 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-06-12 09:26:25 +0200 |
commit | 079fc5df95ee4545e88af0f895a4438cd0886563 (patch) | |
tree | 437b21c58440c05551d27746cc893292430b3fcb /src/main/join_skyblock_entity.lua | |
parent | cdae996583a6342c78a5693724f8f6542f0b00ec (diff) | |
download | skycraft-079fc5df95ee4545e88af0f895a4438cd0886563.tar.xz |
Changed Join Skyblock Entity
Diffstat (limited to 'src/main/join_skyblock_entity.lua')
-rw-r--r-- | src/main/join_skyblock_entity.lua | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/join_skyblock_entity.lua b/src/main/join_skyblock_entity.lua new file mode 100644 index 0000000..ea2cfce --- /dev/null +++ b/src/main/join_skyblock_entity.lua @@ -0,0 +1,29 @@ +local function on_punch_or_rightclick(self, player) + if not player:is_player() then return end + local name = player:get_player_name() + if player:get_wielded_item():get_name() ~= "skycraft:god_stick" then + skycraft.join_skyblock(name) + else + self.object:remove() + end +end + +local function on_activate(self) + self.object:set_pos({x = 17, y = 10000.5, z = 0,}) + self.object:set_yaw(math.pi * 1.5) + self.object:set_nametag_attributes({color = "#00B59A", text = "Join Skyblock"}) + self.object:set_animation({x = 0, y = 79}, 30, 0) + self.object:set_armor_groups({immortal = 1}) +end + +minetest.register_entity("skycraft:join_skyblock", { + initial_properties = { + collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.75, 0.3}, + visual = "mesh", + mesh = "character.b3d", + textures = {"character.png"}, + }, + on_punch = on_punch_or_rightclick, + on_rightclick = on_punch_or_rightclick, + on_activate = on_activate, +}) |