Posted December 6, 20213 yr HI, I've added a block with a custom block model, but I just realized that you need to add a custom hitbox as well, for things like lighting to work properly.
December 6, 20213 yr 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 Also: PLEASE use SPOILERS for logs!
December 6, 20213 yr I don't know. What do you want to achieve? Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can Also: PLEASE use SPOILERS for logs!
December 6, 20213 yr Author 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 December 6, 20213 yr by Kiwilis
December 6, 20213 yr 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 Also: PLEASE use SPOILERS for logs!
December 6, 20213 yr 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 Also: PLEASE use SPOILERS for logs!
December 6, 20213 yr Author 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.