Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-5311

Add API to EntityProjectileThrowable setItem

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • This server is running CraftBukkit version git-Spigot-065a373-9aa7430 (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT)
    • Yes

      Since 1.14 projectiles like Snowball, Enderpeal, and Eggs extend the NMS class 'EntityProjectileThrowable'. This class has a method setItem which accepts an ItemStack to change the displayed / thrown item. This can be used to make any ItemStack throwable or used as a projectile.

       Example:

      Snowball projectile = player.launchProjectile(Snowball.class);
      ((CraftSnowball) projectile).getHandle().setItem(CraftItemStack.asNMSCopy(new ItemStack(Material.CARROT)));
      

       

      It would be great to get this implemented to the API with a setter and getter method.

            Unassigned Unassigned
            crysis992 crysis992
            Votes:
            6 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: