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.

Featured Replies

Posted

I'm Trying to apply a Similar Effect to the Code below Where by on hit of an entity the player is bounced backwards in the opposite direction the player is facing.

Although the below code is for 1.7.2 so its not of much use as reference I figured it would help convey the point. 

public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
    {
        Entity entity =  par3EntityLivingBase;

        Vec3 look = par3EntityLivingBase.getLookVec();


        par3EntityLivingBase.motionX = look.xCoord ;
        par3EntityLivingBase.motionZ = look.zCoord ;
        par3EntityLivingBase.motionY = look.yCoord ;
        par3EntityLivingBase.lastTickPosZ = look.xCoord;
        par3EntityLivingBase.lastTickPosX = look.zCoord;


        set_Item_State(par1ItemStack, false);
        par1ItemStack.damageItem(1, par3EntityLivingBase);
        return true;
    }
  • Author
28 minutes ago, jabelar said:

Okay. So do you have a problem or something? What isn't working?

I'm more so asking how to go about do it as you can no longer use getlookvec with Entityliving or Player Classes

 

4 hours ago, Blaez said:

I'm more so asking how to go about do it as you can no longer use getlookvec with Entityliving or Player Classes

 

You can still get a look vector. They just renamed the method to getLook(). You can figure this out yourself (i.e. when something changes between versions) but looking at the type hierarchy for the class and seeing of any of the methods have a name that suggest it is equivalent behavior.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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...

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.