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.

Minecraft_idk_

Members
  • Joined

  • Last visited

  1. Is there an alternative way to do this in 1.16.4? I don't uderstand how because the entityHit no longer is a thing. @SubscribeEvent public static void tick(TickEvent.ClientTickEvent e) { if (mc.gameSettings.keyBindAttack.isKeyDown()) { if (mc.objectMouseOver.entityHit != null) { Entity entity = mc.objectMouseOver.entityHit; mc.playerController.attackEntity(mc.player, entity); } } }
  2. I don't understand when you can use it or how you can, I made a "PlayerTickEvent" and I want to use "gameSettings" to see if the player pressed any keys to change the "event.player.abilities.setWalkSpeed". But I need to use .getMinecraft() to get the gameSettings. It says "The method getMinecraft() is undefined for the type Minecraft". package com.opl.mod.client.event; import net.minecraft.client.Minecraft; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; @EventBusSubscriber(modid="oplmodid", bus = Bus.FORGE, value = Dist.CLIENT) public class ClientEvents { private static final Minecraft mc = Minecraft.getMinecraft(); @SubscribeEvent public static void onBlockBreak(final TickEvent.PlayerTickEvent event) { if (mc.gameSettings.keyBindAttack.isKeyDown()) { event.player.abilities.setWalkSpeed(3f); } else { event.player.abilities.setWalkSpeed(1f); } } }
  3. trying to make a place event, I don't understand why I can get it because I've imported "import net.minecraftforge.event.world.BlockEvent;" package com.example.examplemod; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.util.stream.Collectors; import static net.minecraft.command.arguments.FunctionArgument.function; import static net.minecraft.entity.EntityType.CREEPER; // The value here should match an entry in the META-INF/mods.toml file @Mod("examplemod") public class ExampleMod { // Directly reference a log4j logger. private static final Logger LOGGER = LogManager.getLogger(); public ExampleMod() { } @SubscribeEvent public void onBlockDropItems(BlockEvent.PlaceEvent event) { System.out.println("ok"); } }
  4. I've tried multiple time to setup a forge workspace, tried multiple versions everytime I try run the "./gradlew genIntellijRuns" command I get this error. I tried doing it on a different IDE I ran this command on windows cmd and with a batch file "gradlew genEclipseRuns --refresh-dependencies". Please be coherent in your reply cause I probably won't understand what you're trying to say cause I'm very new to this.

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.