Link one igniter to multiple portals?

Started by braelin777 on

Topic category: Help with modding (Java Edition)

Last seen on 01:30, 29. Nov 2023
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Link one igniter to multiple portals?

Pretty self explanatory... lol. Anyone got any tips?

Last seen on 13:58, 21. Jan 2023
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
what lighter are you using?…
Sat, 05/07/2022 - 12:35

what lighter are you using? If you want any fire to do the trick then just follow this code

package net.mcreator.workshop.procedures;

/* imports omitted */

@Mod.EventBusSubscriber
public class TestProcedure {
	@SubscribeEvent
	public static void onBlockPlace(BlockEvent.EntityPlaceEvent event) {
		Entity entity = event.getEntity();
		execute(event, event.getWorld(), event.getPos().getX(), event.getPos().getY(), event.getPos().getZ());
	}

	public static void execute(LevelAccessor world, double x, double y, double z) {
		execute(null, world, x, y, z);
	}

	private static void execute(@Nullable Event event, LevelAccessor world, double x, double y, double z) {
		if (BlockTags.getAllTags().getTagOrEmpty(new ResourceLocation("minecraft:fire"))
				.contains((world.getBlockState(new BlockPos((int) x, (int) y, (int) z))).getBlock())) {
			if (world instanceof Level _level)
				PlaceholderPortalBlock.portalSpawn(_level, new BlockPos((int) x, (int) y, (int) z));
			WorkshopMod.LOGGER.info("just add portal maker over and over again");
		}
	}
}

by the way my mod is named workshop and so just replace Workshop with your mod namespace