Skip to content

Commit a7d1ce8

Browse files
RedNestoGrinch
authored andcommitted
Expose auto spin attack ticks
1 parent 2c4e392 commit a7d1ce8

File tree

1 file changed

+13
-0
lines changed
  • src/main/java/org/spongepowered/api/data

1 file changed

+13
-0
lines changed

src/main/java/org/spongepowered/api/data/Keys.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@
200200
import org.spongepowered.api.item.ItemType;
201201
import org.spongepowered.api.item.ItemTypes;
202202
import org.spongepowered.api.item.enchantment.Enchantment;
203+
import org.spongepowered.api.item.enchantment.EnchantmentTypes;
203204
import org.spongepowered.api.item.inventory.Inventory;
204205
import org.spongepowered.api.item.inventory.ItemStack;
205206
import org.spongepowered.api.item.inventory.ItemStackSnapshot;
@@ -342,6 +343,12 @@ public final class Keys {
342343
*/
343344
public static final Key<Value<Ticks>> ATTACK_TIME = Keys.key(ResourceKey.sponge("attack_time"), Ticks.class);
344345

346+
/**
347+
* Remaining ticks of the auto spin attack a {@link Living} is doing.
348+
* @see #IS_AUTO_SPIN_ATTACK
349+
*/
350+
public static final Key<Value<Ticks>> AUTO_SPIN_ATTACK_TICKS = Keys.key(ResourceKey.sponge("auto_spin_attack_ticks"), Ticks.class);
351+
345352
/**
346353
* The author of a {@link ItemTypes#WRITTEN_BOOK} {@link ItemStack}.
347354
*/
@@ -1176,6 +1183,12 @@ public final class Keys {
11761183
*/
11771184
public static final Key<Value<Boolean>> IS_ATTACHED = Keys.key(ResourceKey.sponge("is_attached"), Boolean.class);
11781185

1186+
/**
1187+
* Whether a {@link Living} is doing an auto spin attack (doable with the {@link EnchantmentTypes#RIPTIDE} enchantment.)
1188+
* @see #AUTO_SPIN_ATTACK_TICKS
1189+
*/
1190+
public static final Key<Value<Boolean>> IS_AUTO_SPIN_ATTACK = Keys.key(ResourceKey.sponge("is_auto_spin_attack"), Boolean.class);
1191+
11791192
/**
11801193
* Whether an entity is begging for food.
11811194
* e.g. {@link Cat cats} or tamed {@link Wolf wolves}

0 commit comments

Comments
 (0)