ThatSandwich Posted October 11, 2023 Posted October 11, 2023 (edited) i have a function that gets a random structure from a array of specific structures, but in order for it to work i have to make a list of every structure i want it to work with, which means for it to work with other mods i would have to set them all as dependencies and etc, is there a way to make it so it just gets an array of all the structure for ever mod installed? my current code: Random rndm = new Random(); ArrayList<Structure> structureList = new ArrayList<Structure>(); structureList.add(Structure.MINESHAFT); structureList.add(Structure.PILLAGER_OUTPOST); structureList.add(Structure.WOODLAND_MANSION); structureList.add(Structure.JUNGLE_TEMPLE); structureList.add(Structure.DESERT_PYRAMID); structureList.add(Structure.IGLOO); structureList.add(Structure.RUINED_PORTAL); structureList.add(Structure.SHIPWRECK); structureList.add(Structure.SWAMP_HUT); structureList.add(Structure.OCEAN_MONUMENT); structureList.add(Structure.BURIED_TREASURE); structureList.add(Structure.VILLAGE); Structure rndmElem = structureList.get(rndm.nextInt(structureList.size())); BlockPos structureLocation = new BlockPos(overworld.findNearestMapFeature(rndmElem, playerPos, 100, false)); double xLocation = structureLocation.getX(); double yLocation = playerLocation.y; double zLocation = structureLocation.getZ(); Edited October 11, 2023 by ThatSandwich Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.