• Posts

    • 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • i want to add a trident at player position but nothing happen. @SubscribeEvent public void onClientTickEvent(final TickEvent.ClientTickEvent event) { if(event.phase != TickEvent.Phase.END) return; Minecraft minecraft = Minecraft.getInstance(); if(minecraft.player == null) return; PlayerEntity player = minecraft.player; ItemStack mainHand = player.getHeldItemMainhand(); if(KeyBindingHandler.throw_saber.isPressed() && mainHand.getItem() instanceof BeamSaber) { TridentEntity trident = new TridentEntity(minecraft.world,player,mainHand); minecraft.world.addEntity(trident); } }  
    • That should work, is it possible you just missed the message? Pro tip if you're logging in a spammy log, do something like this to ensure you can see you're message, for (int i = 0; i < 1000; i++) LogManager.getLogger().debug("Common setup fired!"); Please remove it before publishing your mod though.
    • How log have you let it sit once it freezes?
    • This is not going to be pretty, brace yourself.    I saw that I am adding the listener (From the forge example), but that didn't work- so I tried adding subscribe event,- which didn't work because it was a private method. This is the latest attempt at a... log message....    package no.pcservicetbg.advancementextreme; import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.InterModComms; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent; import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent; import net.minecraftforge.fml.event.server.FMLServerStartingEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.util.stream.Collectors; // The value here should match an entry in the META-INF/mods.toml file @Mod("advancementextreme") public class AdvancementExtreme { // Directly reference a log4j logger. private static final Logger LOGGER = LogManager.getLogger(); public AdvancementExtreme() { // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); // Register the enqueueIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC); // Register the processIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC); // Register the doClientStuff method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void setup(final FMLCommonSetupEvent event) { LOGGER.info("Common SETUP"); } private void doClientStuff(final FMLClientSetupEvent event) { } private void enqueueIMC(final InterModEnqueueEvent event) { } private void processIMC(final InterModProcessEvent event) { // some example code to receive and process InterModComms from other mods } // You can use SubscribeEvent and let the Event Bus discover methods to call @SubscribeEvent public void onServerStarting(FMLServerStartingEvent event) { // do something when the server starts } // You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD // Event bus for receiving Registry Events) @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public static class RegistryEvents { @SubscribeEvent public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) { // register a new block here LOGGER.info("HELLO from Register Block"); } } }  
  • Topics

  • Who's Online (See full list)