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.

Ghten

Members
  • Joined

  • Last visited

Everything posted by Ghten

  1. But can I use the event.entityPlayer.isSneaking() inside the BlockEvent.BreakEvent or BlockEvent.HarvestDropsEvent? I couldn't find it :L
  2. That one works kinda. But I want to ignite the tnt when you punch it normally (and not drop anything) and when you punch it and hold shift it shouldn't explode and instead drop the item :L So the drop should only be disabled when I'm not holding shift
  3. @SubscribeEvent public void PlayerInteractEvent(PlayerInteractEvent event) { Block block = event.world.getBlock(event.x, event.y, event.z); if ((event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) && (event.world.getBlock(event.x, event.y, event.z) == Blocks.tnt) && (!event.entityPlayer.isSneaking())) { EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(event.world, (double)((float)event.x + 0.5F), (double)event.y+0.5, (double)((float)event.z + 0.5F), null); event.world.spawnEntityInWorld(entitytntprimed); } } -------------------------------------------------------- I have this code to ignite tnt when you punch it. It works, but it still drops the tnt as an item. How can I fix that? C:
  4. Ghten replied to Ghten's topic in Modder Support
    Ok, I did this: @SubscribeEvent public void PlayerInteractEvent(PlayerInteractEvent event) { Block block = event.world.getBlock(event.x, event.y, event.z); if ((event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) && (event.world.getBlock(event.x, event.y, event.z) == Blocks.tnt) && (!event.entityPlayer.isSneaking())) { EntityTNTPrimed tnt = new EntityTNTPrimed(event.world, event.x, event.y+0.5, event.z, null); event.world.spawnEntityInWorld(tnt); } } } ---------------------------------- It spawns the entity but it still drops the tnt as an item. How can I stop it from being dropped?
  5. Ghten replied to Ghten's topic in Modder Support
    Yeah thanks :L
  6. Ghten replied to Ghten's topic in Modder Support
    But how? :L
  7. Ghten replied to Ghten's topic in Modder Support
    1.10
  8. Ghten posted a topic in Modder Support
    Hello! I wanted to make tnt ignite when you punch/destroy it (Just like in the beta days). Couldn't get it to work though :L Does someone have any idea why this doesn't spawn anything? ---------------------------------------------------------------------------------------------------------------- @Mod(modid = ExampleModThree.MODID, version = ExampleModThree.VERSION) public class ExampleModThree { public static final String MODID = "examplemod3"; public static final String VERSION = "1.0"; public static Entity EntityTNTPrimed; @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void onBreakEvent(BlockEvent.BreakEvent event) { if (event.world.isRemote) { return; } Block block = event.block; if (block == Blocks.tnt) { event.world.spawnEntityInWorld(EntityTNTPrimed); } } }

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.