Bukkit/CraftBukkit — pull request #1291 by Morphan1 (2013-12-09 11:16:47+00:00)
Title: [B+C] Add setCritical and isCritical methods to CraftArrow.java, Adds BUKKIT-5113

The Issue:

At the moment, the only way to create a "critical" arrow is by actually grabbing a bow and arrow, then drawing the string back all the way. There's no current method to force an arrow to become critical.

Justification for this PR

This pull request adds .setCritical(boolean critical) to arrows so you can force an arrow to be critical or not. It also adds a way to check if an arrow is already critical with .isCritical().

PR Breakdown:

By utilizing the .a(boolean flag) method in EntityArrow.java (from net/minecraft/server), the new .setCritical method provides a way to force a spawned-in arrow, or any arrow at all, to be "critical", which includes the particle effects and extra damage, as if you were using full force with a bow.

The new .isCritical method returns whether or not an arrow is already critical, by using EntityArrow.java's .f() method.

Testing Results and Materials:

I made a simple plugin, and it did exactly as expected. The compiled plugin and the source are provided here.
https://dl.dropboxusercontent.com/u/188921928/CriticalArrowTest.jar

When you use a bow to shoot a critical shot, the server announces that. You can also use /critarrow to shoot critical arrows.

Relevant PR(s):

B-998 - https://github.com/Bukkit/Bukkit/pull/988

JIRA Ticket:

BUKKIT-5113 - https://bukkit.atlassian.net/browse/BUKKIT-5113