From c740737a58cb85420637451e62ea21b3290baf0b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 22 Mar 2019 17:37:56 +0100 Subject: [PATCH] Display probability in tool wear bar --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index dbb8c87..ba0c2e0 100644 --- a/init.lua +++ b/init.lua @@ -552,6 +552,9 @@ schemedit.add_form("probtool", { set_item_metadata(probtool, prob, force_place) + -- Repurpose the tool's wear bar to display the set probability + probtool:set_wear(math.floor(((255-prob)/255)*65535)) + player:set_wielded_item(probtool) end end