-
Type:
New Feature
-
Resolution: Fixed
-
Priority:
Minor
-
None
-
Affects Version/s: 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.