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.

Chronothan

Members
  • Joined

  • Last visited

Everything posted by Chronothan

  1. This is how I do it in my Pickup Control mod: package mpmod.common; import mpmod.client.MPKeyHandler; import mpmod.utils.PickupSettings; import mpmod.utils.PlayerHandler; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.event.entity.player.EntityItemPickupEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class PickupEventHandler { // ////////////The Main Event/////////////// @SubscribeEvent public void EntityItemPickupEvent(EntityItemPickupEvent evt) { EntityPlayer player = evt.entityPlayer; EntityItem item = evt.item; System.out.println("PickupEvent Fired!" + evt.entityPlayer.worldObj.isRemote); if (player != null && item != null) { if (PickupSettings.allowAlreadyStackedItems) { if (PlayerHandler.checkPlayerHasItem(item, player)) { return; } } switch (PickupSettings.pickupMode) { case AUTO: { return; } case MANUAL: { if (MPKeyHandler.pickupItemKey.getIsKeyPressed()) { return; } } case INDIVIDUAL: { if (PlayerHandler.isPlayerLookingAt(item, player) && MPKeyHandler.pickupItemKey.getIsKeyPressed()) { return; } } } evt.setCanceled(true); System.out.println("PickupEvent blocked!"); } } } Register a class similar to this with MinecraftForge.EventBus. This blocks all pickups based on the state I have set. You could just read the input directly from Keyboard, and allow the event to happen when the right mouse key is pressed. No bother with overriding and all that. HOWEVER, this will ONLY work in singleplayer. I really really wish this could just be a clientside mod. You would think it would be easy. Unfortunately, this event is only called serverside and I haven't gotten around to figuring out a packet system to enable multiplayer support.

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.