Jump to content

Recommended Posts

Posted

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!

Posted

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.

Posted

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.

Posted (edited)
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 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.