How to set a Blockhitbox to a Customblock (JSON)

Started by Sasky on

Topic category: Help with modding (Java Edition)

Last seen on 20:09, 31. Aug 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to set a Blockhitbox to a Customblock (JSON)

I created a Block with Blockbench imported it with Json but the Hitbox is not good so how i set a Hitbox to my Model

Last seen on 00:08, 7. Sep 2024
Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
is this what you are looking…
Sat, 06/13/2020 - 13:00

is this what you are looking for?

@Override
		public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) {
			switch ((Direction) state.get(FACING)) {
				case UP :
				case DOWN :
				case SOUTH :
				default :
					return VoxelShapes.create(1D, 0D, 1D, 0D, 1.8D, 0D);
				case NORTH :
					return VoxelShapes.create(0D, 0D, 0D, 1D, 1.8D, 1D);
				case WEST :
					return VoxelShapes.create(0D, 0D, 1D, 1D, 1.8D, 0D);
				case EAST :
					return VoxelShapes.create(1D, 0D, 0D, 0D, 1.8D, 1D);
			}
		}

 

Last seen on 20:09, 31. Aug 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No i mean bounding box i…
Sat, 06/13/2020 - 13:03

No i mean bounding box i solved it !

 

 

Last seen on 16:41, 7. Jun 2023
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hi Sasky i know this toppic…
Sat, 01/02/2021 - 14:58

Hi Sasky i know this toppic is a bit old but can you say me how do you set hitbox as costume json?