Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello.

 

I've created a Pickup Handler, but it looks like that this Pickup Handler won't load.

Common Proxy

 

@Override
public void registerEventHooks()
{
	FMLCommonHandler.instance().bus().register(new PlayerDimensionEventHook());
	FMLCommonHandler.instance().bus().register(new PlayerPickupEventHook());
	FMLCommonHandler.instance().bus().register(new PlayerEventHook());

	MinecraftForge.EVENT_BUS.register(new BonemealEventHook());
	//MinecraftForge.EVENT_BUS.register(new PlayerPickupEventHook());

	GameRegistry.registerFuelHandler(new FFuelHandler());
}

 

(I tested it with both, MinecraftForge.EVENT_BUS.register and FMLCommonHandler.instance().bus().register)

 

PlayerPickupEventHook

 

package minecraftplaye.primevalforest.event;

import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import minecraftplaye.primevalforest.achievement.PFAchievementPage;
import minecraftplaye.primevalforest.blocks.PFBlocks;
import net.minecraft.item.ItemStack;

public class PlayerPickupEventHook
{
   
/**
     * Checks if the player picks an Item or Block up!
     * 
     * @param event The MCForge ItemPickupEvent
     */
@SideOnly(Side.SERVER)
@SubscribeEvent(priority = EventPriority.NORMAL)
public void notifyPickup(PlayerEvent.ItemPickupEvent  event)
{
	System.out.println("YOLO");
	if(event.pickedUp.getEntityItem().isItemEqual(new ItemStack(PFBlocks.port_sapling)))
	{
		System.out.println("YOLO2");
		event.player.triggerAchievement(PFAchievementPage.forgotten_sapling);
		event.player.addExperience(25);
	}
}
}

 

 

I'm using Forge 1.7.2-10.12.1.1103.

 

EDIT: Ok, I solved it, forgot to remove the SideOnly... in the Event class

Bektor

Developer of Primeval Forest.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.