Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Trying to change gun aiming!
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
FireIsH0t

Trying to change gun aiming!

By FireIsH0t, December 24, 2018 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

FireIsH0t    1

FireIsH0t

FireIsH0t    1

  • Stone Miner
  • FireIsH0t
  • Members
  • 1
  • 57 posts
Posted December 24, 2018
    /**
     * returns the action that specifies what animation to play when the items is being used
     */
    @Override
    public EnumAction getItemUseAction(final ItemStack stack)
    {
        return EnumAction.BOW;
    }

    /**
     * Called when the equipped item is right clicked.
     */
    @Override
    public ActionResult<ItemStack> onItemRightClick(final World worldIn, final EntityPlayer playerIn, final EnumHand handIn)
    {
        final ItemStack itemstack = playerIn.getHeldItem(handIn);
        final boolean flag = !this.findAmmo(playerIn).isEmpty();

        if (!playerIn.capabilities.isCreativeMode && !flag)
        {
            return flag ? new ActionResult<>(EnumActionResult.PASS, itemstack) : new ActionResult<>(EnumActionResult.FAIL, itemstack);
        }
        else
        {
            playerIn.setActiveHand(handIn);
            return new ActionResult<>(EnumActionResult.SUCCESS, itemstack);
        }

    }

Alright so I got this in my ItemGun class. When I aim it shows just like a bow: http://prntscr.com/lytsr5 anyway to possible like use glstatemanager and rotate/translate it?

  • Quote

Share this post


Link to post
Share on other sites

FireIsH0t    1

FireIsH0t

FireIsH0t    1

  • Stone Miner
  • FireIsH0t
  • Members
  • 1
  • 57 posts
Posted December 24, 2018

bump

  • Quote

Share this post


Link to post
Share on other sites

jabelar    593

jabelar

jabelar    593

  • Reality Controller
  • jabelar
  • Members
  • 593
  • 3266 posts
Posted December 26, 2018

I think so. I think maybe you can maybe you can handle the RenderHandEvent or the RenderSpecificHandEvent. You might also want to rotate the original model. 

 

Note that it (in order to be more gun-like) may be more important to control the rotation of the whole hand.

  • Quote

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      Valhelsia 3 server not starting

      By diesieben07 · Posted 23 minutes ago

      You can use https://gist.github.com/ for large text files.
    • diesieben07
      Disconnection From Server When Placing Modded Block

      By diesieben07 · Posted 24 minutes ago

      Your repository crashes for a different reason: You have two items with the same name. Additionally, you are not registering your registry entries properly. You need to either use @ObjectHolder or DeferredRegister.
    • squidlex
      Check if player wakes up in the Morning

      By squidlex · Posted 26 minutes ago

      This is perfect, thank you!
    • diesieben07
      Check if player wakes up in the Morning

      By diesieben07 · Posted 29 minutes ago

      The world time is definitely updated before the event is fired (see ServerWorld#tick, where it calls wakeUpAllPlayers). There is also SleepFinishedTimeEvent, which fires when the server decides that all players are asleep and changes the time to day, it is fired before the time changes and before all players are woken up.
    • octa
      Disconnection From Server When Placing Modded Block

      By octa · Posted 38 minutes ago

      Repo is fixed. How do I run my client with system properties? It works on the server but when I add it to JVM arguments in the launcher's installation settings the game crashes.
  • Topics

    • Purity
      7
      Valhelsia 3 server not starting

      By Purity
      Started 15 hours ago

    • octa
      3
      Disconnection From Server When Placing Modded Block

      By octa
      Started 3 hours ago

    • squidlex
      2
      Check if player wakes up in the Morning

      By squidlex
      Started 43 minutes ago

    • squidlex
      2
      How to create the regeneration effect on hearts for other HUD elements

      By squidlex
      Started 22 hours ago

    • Tyrone117
      4
      Unable to install forge 1.16.5

      By Tyrone117
      Started 15 hours ago

  • Who's Online (See full list)

    • UnderBlade
    • vemerion
    • TheidenHD
    • Yuqera
    • Shlub
    • octa
    • _xlxrenz_
    • loordgek
    • kikohou
    • CapeGamerBoi
    • Purity
    • diesieben07
    • XDKara
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Trying to change gun aiming!
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community