"external trigger that does not provide the following dependencies: itemstack" (problem) please help me fix this

Started by ali4todaylol on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
"external trigger that does not provide the following dependencies: itemstack" (problem) please help me fix this

please someone help me fix this 
<a href="https://ibb.co/8nzR9T0G"><img src="https://i.ibb.co/8nzR9T0G/image-2025-04-08-191359513.png" alt="image-2025-04-08-191359513" border="0"></a>

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i couldnt upload a picture…
Tue, 04/08/2025 - 17:16

i couldnt upload a picture so heres the code:

"package net.mcreator.frontier.procedures;

/* imports omitted */

@EventBusSubscriber

public class AngelsSwordRightclickedProcedure {

    @SubscribeEvent

    public static void onRightClickBlock(PlayerInteractEvent.RightClickBlock event) {

        if (event.getHand() != event.getEntity().getUsedItemHand())

            return;

        execute(event, event.getLevel(), event.getPos().getX(), event.getPos().getY(), event.getPos().getZ(), event.getEntity());

    }



    public static void execute(LevelAccessor world, double x, double y, double z, Entity entity, ItemStack itemstack) {

        execute(null, world, x, y, z, entity, itemstack);

    }



    private static void execute(@Nullable Event event, LevelAccessor world, double x, double y, double z, Entity entity, ItemStack itemstack) {

        if (entity == null)

            return;

        if (world instanceof ServerLevel _level) {

            LightningBolt entityToSpawn = EntityType.LIGHTNING_BOLT.create(_level, EntitySpawnReason.TRIGGERED);

            entityToSpawn.moveTo(Vec3.atBottomCenterOf(BlockPos.containing(x, y, z)));;

            _level.addFreshEntity(entityToSpawn);

        }

        if (entity instanceof Player _player)

            _player.getCooldowns().addCooldown(itemstack, 400);

    }

} "