Jump to content

Recommended Posts

Posted

Hey, guys. So, I'm entering the world of Minecraft Modding now and have some doubts. I'm learning through O'Reilly's book, but the forgw version he uses is fairly old (I develop in the Forge 1.14.4). I'm in a part of the book that I need to change the MotionY and the best solution I came was this one:

 

package mod.stardev.mod1.init;

import mod.stardev.mod1.tutorialmod;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber(modid = tutorialmod.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE)
public class supers {

    public static void superjump(LivingEvent.LivingJumpEvent event) {
        if (!(event.getEntity() instanceof PlayerEntity)) {
            return;
        }

        PlayerEntity player = (PlayerEntity) event.getEntity();

        Vec3d v = player.getMotion();
        player.setMotion(v.x, v.y * 5.0D, v.z);

    }

}

 

But it's not working, no matter what I change. Please, help me.

 

The Main file:

 

package mod.stardev.mod1;

import net.minecraftforge.fml.common.Mod;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

@Mod(tutorialmod.MODID)
public final class tutorialmod {
    public static final String MODID = "tutorialmod";

    public static final Logger LOGGER = LogManager.getLogger(MODID);

    public tutorialmod() {
        LOGGER.debug("Hello from TutorialMod.");
    }
}
Posted

Your method is not being called because it lacks @SubscribeEvent

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
1 minute ago, Draco18s said:

Your method is not being called because it lacks @SubscribeEvent

Omg!!!! How haven't I seen it

Thanks mannn

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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