Jump to content

Newww

Members
  • Posts

    16
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Newww's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  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?
×
×
  • Create New...

Important Information

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