New gun item

A big new update is now available, introducing biomes, caves and much more!
Latest hotfix: 0.7.0.3 (2024-02-21)
  • I managed to get this item in the game after using the Potato Cannon source, however, I can't make it do any aiming when holding right click, and it won't do damage. I'm pretty stumped as to what to do next, so any tips (or help) are/is appreciated!
    yahwho or red51 - You might know something about this?


  • I just seem to be having problems getting it to sight in (right click zoom in)

    Implementing proper aiming for custom weapons is tricky... unfortunately it's not sufficient to set an aim animation, it's also necessary to modify the body position for that. The API, however, does not offer a way to do that smoothly. Basically you could bind that as secondary action (setSecondaryAction()), i.e. change the item/body position when the secondary action is triggered, but this won't give a satisfying result...


    We'll provide more control over these things in the new API though ;)


    and also do damage like the Semi-Auto Rifle.

    When shooting the rifle (i.e. in the setPrimaryAction() callback) you can spawn an actual projectile by calling World.spawnProjectile(). If you set the projectile id of the semi-auto rifle (5), it will behave like that (and it also deals the same amount of damage).

  • Implementing proper aiming for custom weapons is tricky... unfortunately it's not sufficient to set an aim animation, it's also necessary to modify the body position for that. The API, however, does not offer a way to do that smoothly. Basically you could bind that as secondary action (setSecondaryAction()), i.e. change the item/body position when the secondary action is triggered, but this won't give a satisfying result...


    We'll provide more control over these things in the new API though ;)


    When shooting the rifle (i.e. in the setPrimaryAction() callback) you can spawn an actual projectile by calling World.spawnProjectile(). If you set the projectile id of the semi-auto rifle (5), it will behave like that (and it also deals the same amount of damage).

    Thank you for the infos!

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!