Jump to content

Recommended Posts

Posted

Hi!

You need to override the Voxelshape of your block.

I don't know how the Method is named, but it's something like getShape. Search in your IDE for overridable methods that contain"shape" in their name (In Eclipse: Alt+Shift+S+V I think and then type "*shape" )

Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can :D

Also: PLEASE use SPOILERS for logs!

Posted (edited)

Set a custom hitbox for my block, but what class needs to call the function and what schould be the parameters. I tried to look into the minecraft code for an example of the method being called there, but couldn't find one.

Edited by Kiwilis
Posted

You need to override the method getShape or getVoxelShape or something like that in your Block class and return your own VoxelShape

Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can :D

Also: PLEASE use SPOILERS for logs!

Posted

For an example look into the slab class (that all the slabs extend)

 

Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can :D

Also: PLEASE use SPOILERS for logs!

Posted

When I try @Override getState() I get this error: "error: getShape(BlockState,BlockGetter,BlockPos,CollisionContext) in CaoutchoucDrain cannot override getShape(BlockState,BlockGetter,BlockPos,CollisionContext) in BlockBehaviour".

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.