Posted September 18, 20196 yr Hi so im using forge version 1.12.2. Trying to work on a pretty interesting mod with good knowledge of java and how it works, just not the Forge API and i have trouble sometimes finding where to properly learn the entire API and how it works, there should be a forge school or something. Anyways, i'm trying to create a Multiblock structure. Basically i'm making a sacrifice bowl, that needs to be surrounded by 3 1x1 shrine blocks 2 blocks spaced out from each other. I want the shrines to spawn particles to move toward the bowl then eventually transforming the contents of the bowl (just a container with a inventory of 4 **3 ingredients, 1 output**) into an item and ejecting it out of the inventory as an item spawn. I'm not sure if i need to use multiblocks to do this, but it does require multiple blocks to work (all be it not connected). It's more of a crafting altar i suppose, similar to thaumcraft if that is a good reference point. Any assistance would be much appreciated, thanks!
September 18, 20196 yr The way I'd go about doing this would be to just check to see if the shrines are there whenever anything important is happening, else said important thing doesn't happen. Fancy 3D Graphing Calculator mod, with many different coordinate systems. Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.
September 18, 20196 yr Unfortunately there's no method you can use to scan the nearby area for blocks, but you can get the IBlockState at a given BlockPos with World#getBlockState, and use nested for loops to check all positions within a cube. If you want to check in a sphere, you could use the cube method but then continue whenever the BlockPos is further than the radius away. Fancy 3D Graphing Calculator mod, with many different coordinate systems. Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.
September 18, 20196 yr 1 hour ago, EmeraldJelly said: How would I do that , not sure how to Check in a radius Another method to use is BlockPattern private BlockPattern pattern = FactoryBlockPattern.start().aisle( "010", "020", "030") .where('1', BlockWorldState.hasState(BlockStateMatcher.forBlock(ModBlocks.Block1))) .where('2', BlockWorldState.hasState(BlockStateMatcher.forBlock(ModBlocks.Block2))) .where('3', BlockWorldState.hasState(BlockStateMatcher.forBlock(ModBlocks.Block3))) .where('0', BlockWorldState.hasState(BlockStateMatcher.ANY)).build(); It searches in a variable radius around your center block (in this case, Block2) to find other blocks defined in your pattern. Edited September 18, 20196 yr by ModMCdl Follow these rules when talking to me, and we'll get along fine. 1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them. 2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't? 3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum. ModMCdl - Co-Founder and Director of Design for Artemis Game Studios
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.