Jump to content

Need help creating a custom outline box at the highlighted Block[1.8]


ItsAMysteriousYT

Recommended Posts

In my blocks i have a fild like the blockBounds holding minX,minY&minZ aswell as maxX, maxY, maxZ. No if the player is holding the item of that block i wanna draw a box showing the player how big the block will be and where he can set it. I tried this in DrawBlockHighlight event, but the box is at the players position and not at the position of the highlighted block. How can i fix this?

 

So this i swhat i currently do:

	@SubscribeEvent
	public void onBlockHighlight(DrawBlockHighlightEvent e){
		if(e.player.getCurrentEquippedItem()!=null){
			Item i = e.player.getCurrentEquippedItem().getItem();
			if(Block.getBlockFromItem(i) instanceof RLMBlockContainer){
				RLMBlockContainer b = (RLMBlockContainer) Block.getBlockFromItem(i);
				BlockPos p = e.target.getBlockPos();
				e.context.drawOutlinedBoundingBox(new AxisAlignedBB(b.dimensions[0], b.dimensions[1],b.dimensions[2],b.dimensions[3], b.dimensions[4], b.dimensions[5]), 100);
			}
		}
	}

 

And this is how it looks:

P8mz69H.png

Link to comment
Share on other sites

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.