Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

So, I've been using the

 

public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axis, List list, Entity entity)

 

method to make a chair and changing where the collision boxes are based on metadata to move the direction

it worked fine for 2 of them (each having 1 base collision box that doesn't change and 3 that do) facing in 2 directions

but I'm onto the third one and now the collision boxes aren't... well... colliding anymore

 

I can mouse over them and they highlight, but I'm just walking straight through them

 

so, is there a limit to how many you can add in?

because the ones I can walk through are literally the same as the others that actually collide

 

full method is

 

public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_)
    {	
	int i = p_149743_1_.getBlockMetadata(p_149743_2_, p_149743_3_, p_149743_4_);
	this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.625F, 0.9375F);
	super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);

	//DONE
	if(i == 4)
	{
		this.setBlockBounds(0.9375F, 0.0F, 0.0625F, 0.875F, 1.625F, 0.9375F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
		this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.875F, 1.0625F, 0.1875F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
		this.setBlockBounds(0.0625F, 0.0F, 0.9375F, 0.875F, 1.0625F, 0.8125F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
	}
	//DONE
	if(i == 3)
	{
		this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.625F, 0.125F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
		this.setBlockBounds(0.8125F, 0.0F, 0.125F, 0.9375F, 1.0625F, 0.9375F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
		this.setBlockBounds(0.0625F, 0.0F, 0.125F, 0.1875F, 1.0625F, 0.9375F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
	}

	if(i == 5)
	{
		this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.125F, 1.625F, 0.9375F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
		this.setBlockBounds(0.9375F, 0.0F, 0.0625F, 0.125F, 2.0625F, 0.1875F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
	}


	if(i == 2)
	{
		this.setBlockBounds(0.125F, 0.0F, 0.750F, 0.8125F, 1.625F, 0.875F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
	}



        this.setBlockBoundsForItemRender();
    }

 

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.