From c1ad39febd0ba1d4a8ecc061814d18e514118e22 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 21 May 2017 05:55:55 +0200 Subject: [PATCH] Exhaust player for hitting by arrow --- mods/ITEMS/mcl_throwing/arrow.lua | 7 +++++++ mods/ITEMS/mcl_throwing/depends.txt | 1 + 2 files changed, 8 insertions(+) diff --git a/mods/ITEMS/mcl_throwing/arrow.lua b/mods/ITEMS/mcl_throwing/arrow.lua index 53bd35d6d..f82dcba45 100644 --- a/mods/ITEMS/mcl_throwing/arrow.lua +++ b/mods/ITEMS/mcl_throwing/arrow.lua @@ -62,6 +62,9 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime) full_punch_interval=1.0, damage_groups={fleshy=self._damage}, }, nil) + if obj:is_player() then + mcl_hunger.exhaust(obj:get_player_name(), mcl_hunger.EXHAUST_DAMAGE) + end -- Achievement for hitting skeleton, wither skeleton or stray (TODO) with an arrow at least 50 meters away -- TODO: This achievement should be given for the kill, not just a hit @@ -77,6 +80,10 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime) full_punch_interval=1.0, damage_groups={fleshy=self._damage}, }, nil) + if obj:is_player() then + mcl_hunger.exhaust(obj:get_player_name(), mcl_hunger.EXHAUST_DAMAGE) + end + self.object:remove() end end diff --git a/mods/ITEMS/mcl_throwing/depends.txt b/mods/ITEMS/mcl_throwing/depends.txt index 47e619f19..2a2a55339 100644 --- a/mods/ITEMS/mcl_throwing/depends.txt +++ b/mods/ITEMS/mcl_throwing/depends.txt @@ -1,3 +1,4 @@ mcl_core +mcl_hunger mcl_achievements doc?