Jump to content

daniel0916

Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by daniel0916

  1. Okay, but the event doesn't get called.

     

    @SubscribeEvent
    public void onItemUse(PlayerUseItemEvent event) {
    	System.out.println(event.item.getItem());
    	System.out.println(Item.getIdFromItem(event.item.getItem()));
    }

     

    MinecraftForge.EVENT_BUS.register(new Events());

     

    "This event is separated in sub-phase events, make sure you picked right one."

    What do you mean with this exactly?

     

    Edit: Ah, okay. I understand it now.

     

    Edit2: Okay, the event is working when i block with the sword but i need a event which get called when i make right-click with a compass.

  2. Hello guys,

     

    i'm a beginner in Forge Development and i have a problem with using events.

     

    Code:

    @Mod(modid = Test.MODID, version = Test.VERSION)
    public class Test {
        public static final String MODID = "Test";
        public static final String VERSION = "1.0";
        
        @EventHandler
        public void init(FMLInitializationEvent event) {
        	MinecraftForge.EVENT_BUS.register(new CommandListener());
        	
        	//FMLCommonHandler.instance().bus().register(new ExecuteEvent());
        }
    }

     

    public class CommandListener {
    
    public void onCommand(CommandEvent event) {
    	System.out.println(event.command);
    }
    }

     

    I don't get the message. What's wrong?

     

    Thanks for reading my question.

     

    Greetings

    Daniel

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.