doouble tall block

Started by Sec-To-Bar on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
doouble tall block

i need to create a double tall block for my mod, but i cant find any similar posts that arent about crops and blockadded doesnt have a dependency for block direction which is required for the 2 blocks

Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have an example from a mod…
Thu, 06/23/2022 - 00:36

I have an example from a mod I have been tinkering with the last few weeks:

procedure

I have two seperate blocks for the top half and bottom half, and this procedure is tiggered by the "On block added" of the bottom half block. This also takes the block direction into account.

Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
but the "when block added"…
Sat, 06/25/2022 - 23:06

but the "when block added" trigger doesnt have a dependency for direction and wont let me add the procedure

Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
My bad - "When block is…
Sun, 06/26/2022 - 04:56

My bad - "When block is placed by" should be the correct trigger.

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
what if i were to make an 2…
Tue, 08/29/2023 - 15:36

what if i were to make an 2 wide block, that works with rotation??

 

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you for the help! I…
Sat, 07/13/2024 - 06:11

Thank you for the help! I needed help on a mod of mine and it really helped! Thank you again!

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Greetings! I'm trying to…
Mon, 04/28/2025 - 15:37

Greetings! I'm trying to make a decorative lamp two blocks high. I would like it to break both blocks when any of the blocks are broken. I don't know programming, but I'm trying this code that Octave_ posted, but it won't let me use it in the trigger, and it tells me that it requires dependencies, but I don't know how to fix it. The dependencies it asks for are Entity, x, y, z, and World. 
 

 

This is the code, I hope you can help me.

 

package net.mcreator.multiblock.procedures;

/* imports omitted */

public class MultiBlockAlSerColocadoElBloqueProcedure {
	public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) {
		if (entity == null)
			return;
		if ((world.getBlockState(BlockPos.containing(x, y + 1, z))).getBlock() == Blocks.AIR) {
			world.setBlock(BlockPos.containing(x, y + 1, z), MultiblockModBlocks.TOP_BLOCK.get().defaultBlockState(), 3);
			{
				Direction _dir = (new Object() {
					public Direction getDirection(BlockPos pos) {
						BlockState _bs = world.getBlockState(pos);
						Property<?> property = _bs.getBlock().getStateDefinition().getProperty("facing");
						if (property != null && _bs.getValue(property) instanceof Direction _dir)
							return _dir;
						else if (_bs.hasProperty(BlockStateProperties.AXIS))
							return Direction.fromAxisAndDirection(_bs.getValue(BlockStateProperties.AXIS), Direction.AxisDirection.POSITIVE);
						else if (_bs.hasProperty(BlockStateProperties.HORIZONTAL_AXIS))
							return Direction.fromAxisAndDirection(_bs.getValue(BlockStateProperties.HORIZONTAL_AXIS), Direction.AxisDirection.POSITIVE);
						return Direction.NORTH;
					}
				}.getDirection(BlockPos.containing(x, y, z)));
				BlockPos _pos = BlockPos.containing(x, y + 1, z);
				BlockState _bs = world.getBlockState(_pos);
				Property<?> _property = _bs.getBlock().getStateDefinition().getProperty("facing");
				if (_property instanceof DirectionProperty _dp && _dp.getPossibleValues().contains(_dir)) {
					world.setBlock(_pos, _bs.setValue(_dp, _dir), 3);
				} else {
					_property = _bs.getBlock().getStateDefinition().getProperty("axis");
					if (_property instanceof EnumProperty _ap && _ap.getPossibleValues().contains(_dir.getAxis()))
						world.setBlock(_pos, _bs.setValue(_ap, _dir.getAxis()), 3);
				}
			}
		} else {
			if (entity instanceof Player _player) {
				ItemStack _setstack = new ItemStack(MultiblockModBlocks.MULTI_BLOCK.get()).copy();
				_setstack.setCount(1);
				ItemHandlerHelper.giveItemToPlayer(_player, _setstack);
			}
			world.setBlock(BlockPos.containing(x, y, z), Blocks.AIR.defaultBlockState(), 3);
		}
	}
}