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.

Newww

Members
  • Joined

  • Last visited

  1. Well, I'm not going to update since I want this modification to work in 1.7.10 :L Does it make much of a difference with the code?
  2. Tried that before, didn't make much of a difference lol
  3. Why do I need any Proxies? :L
  4. _________________________________________ public class StringFix { @SubscribeEvent public static void PlayerUseItemEvent(net.minecraftforge.event.entity.player.PlayerUseItemEvent.Start event) { ItemStack itemstack = event.entityPlayer.inventory.getCurrentItem(); if (itemstack.getItem() == Items.string) { event.setCanceled(true); } } } __________________________________ Ok, that's my current code. But he still places down those tripwires :L And about that @SubscribeEvent, I need that right? And here's my main file, if there's a mistake in there lol ___________________________________________ package com.example.examplemod; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.init.Blocks; import net.minecraftforge.common.MinecraftForge; @Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION) public class ExampleMod { public static final String MODID = "examplemod"; public static final String VERSION = "1.0"; @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new StringFix()); } }
  5. It doesn't do anything. Still places that dumb tripwire :L Is " PlayerUseItemEvent " even the correct on to use?
  6. Like this? :L ___________________________________________ public void PlayerUseItemEvent(net.minecraftforge.event.entity.player.PlayerUseItemEvent.Start event, Item itemStack) { ItemStack itemstack = event.entityPlayer.inventory.getCurrentItem(); if (itemstack.getItem() == Items.string) { event.setCanceled(true); } }
  7. Don't make it so difficult for me :L I just wanted to know how I could get that code to work. I'm just not good with java :L
  8. Could you maybe write that short piece of code for me to copy? That would be really kind of you!
  9. I'm just going to stop and hope that someone else writes a mod that does the same thing lol.
  10. And is " event.setCanceled(true); " at the end enough to cancel the right click action, so it doesn't place the string? Or do I need to say which event has to get canceled?
  11. Ahhh D: I'm sorry, but I really don't know how to translate that into code.
  12. " ItemStack getItem; " gets the item out of the stack right? But what's the single item called? _______________________________________________ public class TripWireRem { public void PlayerUseItemEvent(net.minecraftforge.event.entity.player.PlayerUseItemEvent.Start event, Item itemStack) { ItemStack getItem; if (Item == Items.string) { event.setCanceled(true); } } }
  13. Ok, thanks! I'm just having some problems translating that into some working code :L _________________________________________________________________________ public void PlayerUseItemEvent(net.minecraftforge.event.entity.player.PlayerUseItemEvent.Start event, Item itemStack) { ItemStack getItem; if (itemStack == Items.string) { event.setCanceled(true); } }
  14. public void PlayerUseItemEvent(net.minecraftforge.event.entity.player.PlayerUseItemEvent.Start event, Item itemStack) { ItemStack item = event.item; if (itemStack == Items.string) { event.item.useItemRightClick(null, null); } } ___________________________________________________________________ That's how far I got, not really far at all lol. I want string to do nothing at all when you right click it, just like gunpowder or glowstone for instane. Does someone have an idea what I could do?

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.