From 2bc63d081a8cb63cb18167ca0b20202a9a283ba5 Mon Sep 17 00:00:00 2001 From: fdai7430 Date: Wed, 25 Jan 2023 10:30:32 +0100 Subject: [PATCH] =?UTF-8?q?Implemented=20useItem(=E2=80=A6=20Mob)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/bitbiome/commands/UseCommand.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/UseCommand.java b/src/main/java/org/bitbiome/commands/UseCommand.java index 4302f7d..d35b331 100644 --- a/src/main/java/org/bitbiome/commands/UseCommand.java +++ b/src/main/java/org/bitbiome/commands/UseCommand.java @@ -26,11 +26,12 @@ public class UseCommand implements CommandAPI { if(message.length == 1) return useItem(item, player); String targetName = message[1]; - ArrayList mobs = player.getLocation().getMobList(); + Location loc = player.getLocation(); + ArrayList mobs = loc.getMobList(); for(int j = 0; j=hp) { + location.getMobList().remove(target); + return "You killed " + target.getName() + " with " + item.getName(); + } + target.setHp(hp-dmg); + target.setFriendly(false); + return "You used " + item.getName() + " on " + target.getName(); } } \ No newline at end of file