diff --git a/paper-api/src/main/java/io/papermc/paper/entity/Bucketable.java b/paper-api/src/main/java/io/papermc/paper/entity/Bucketable.java new file mode 100644 index 0000000000..a63c3d0fe5 --- /dev/null +++ b/paper-api/src/main/java/io/papermc/paper/entity/Bucketable.java @@ -0,0 +1,41 @@ +package io.papermc.paper.entity; + +import org.bukkit.Sound; +import org.bukkit.entity.Entity; +import org.bukkit.inventory.ItemStack; +import org.jspecify.annotations.NullMarked; + +/** + * Represents an entity that can be bucketed. + */ +@NullMarked +public interface Bucketable extends Entity { + + /** + * Gets if this entity originated from a bucket. + * + * @return originated from bucket + */ + boolean isFromBucket(); + + /** + * Sets if this entity originated from a bucket. + * + * @param fromBucket is from a bucket + */ + void setFromBucket(boolean fromBucket); + + /** + * Gets the base itemstack of this entity in a bucket form. + * + * @return bucket form + */ + ItemStack getBaseBucketItem(); + + /** + * Gets the sound that is played when this entity + * is picked up in a bucket. + * @return bucket pickup sound + */ + Sound getPickupSound(); +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Axolotl.java b/paper-api/src/main/java/org/bukkit/entity/Axolotl.java index 9763f3b9ac..c8c738b1b7 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Axolotl.java +++ b/paper-api/src/main/java/org/bukkit/entity/Axolotl.java @@ -5,7 +5,7 @@ import org.jetbrains.annotations.NotNull; /** * An Axolotl. */ -public interface Axolotl extends Animals { +public interface Axolotl extends Animals, io.papermc.paper.entity.Bucketable { // Paper - Bucketable API /** * Gets if this axolotl is playing dead. diff --git a/paper-api/src/main/java/org/bukkit/entity/Fish.java b/paper-api/src/main/java/org/bukkit/entity/Fish.java index 82e390b215..86da8dc401 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Fish.java +++ b/paper-api/src/main/java/org/bukkit/entity/Fish.java @@ -3,4 +3,4 @@ package org.bukkit.entity; /** * Represents a fish entity. */ -public interface Fish extends WaterMob { } +public interface Fish extends WaterMob, io.papermc.paper.entity.Bucketable { } // Paper - Bucketable API