Posted October 7, 20178 yr I'd like to make it so the player can move through leaf blocks. Is there any way to modify or remove a vanilla block's collision box? I found a few old comments about people making this happen, but with no description. The one actual example I found used ASM. Not sure how to approach this or if it's even possible without ASM?
October 8, 20178 yr Author Never heard of that one before. I was looking at a super old list of events that I got somewhere. It's a nice list because it summarizes a lot of information about tons of events on a single page. But it's pretty outdated. Next time I need to remember to check out the REAL list in my IDE.
October 8, 20178 yr Author Cool. That ended up being pretty easy. The GetCollisionBoxesEvent gives you a list of all the collision boxes involved in the event. I created an iterator to iterate over the list. From each AxisAlignedBB you can get a Vec3d of the center, from that you can get a BlockPos, and from that you can get the block. If it's a leaf block, remove the AxisAlignedBB from the list. I made the mistake of doing a regular for-loop over the list at first and got a concurrent modification exception. That's why I switched to an iterator.
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.