From f6fb656ecd0267b648c67d1a4c124b2da8c6d036 Mon Sep 17 00:00:00 2001 From: Juliakn66 <117075450+Juliakn66@users.noreply.github.com> Date: Fri, 3 Feb 2023 15:13:24 +0100 Subject: [PATCH] generate random mobs and items in Lookaround Command() --- .../bitbiome/commands/LookaroundCommand.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/main/java/org/bitbiome/commands/LookaroundCommand.java b/src/main/java/org/bitbiome/commands/LookaroundCommand.java index 2f3b77f..e6b632d 100644 --- a/src/main/java/org/bitbiome/commands/LookaroundCommand.java +++ b/src/main/java/org/bitbiome/commands/LookaroundCommand.java @@ -32,8 +32,39 @@ public class LookaroundCommand implements CommandAPI{ JSONArray items = locationObject.getJSONArray("items"); JSONArray mobs = locationObject.getJSONArray("mobs"); + Random random = new Random(); + int randomNumberItems = random.nextInt(items.length()+1); + int randomNumberMobs = random.nextInt(mobs.length()+1); ArrayList foundItems = location.getItemList(); + foundItems.removeAll(foundItems); ArrayList foundMobs = location.getMobList(); + foundMobs.removeAll(foundMobs); + + for (int i=0; i