1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-03-20 22:18:58 +01:00

Fix "DEFAULT" SpawnReason of fish spawned by bucket ()

* Add SpawnReason "Bucket". Fix "DEFAULT" SpawnReason for entity spawning from mob bucket

* Clarify SpawnReason description for bucket entity spawning
This commit is contained in:
Vincenzo Reina 2025-03-05 13:28:25 +01:00 committed by GitHub
parent a866e366b2
commit 5538d24d72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions
paper-api/src/main/java/org/bukkit/event/entity
paper-server/patches/sources/net/minecraft/world/item

View file

@ -211,6 +211,10 @@ public class CreatureSpawnEvent extends EntitySpawnEvent {
* When an entity spawns from an ominous item spawner
*/
OMINOUS_ITEM_SPAWNER,
/**
* When an entity spawns from a bucket
*/
BUCKET,
// Paper end - Fixes and additions to the SpawnReason API
/**
* When a creature is spawned by a potion effect, for example:

View file

@ -0,0 +1,11 @@
--- a/net/minecraft/world/item/MobBucketItem.java
+++ b/net/minecraft/world/item/MobBucketItem.java
@@ -58,7 +_,7 @@
}
if (mob != null) {
- serverLevel.addFreshEntityWithPassengers(mob);
+ serverLevel.addFreshEntityWithPassengers(mob, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BUCKET); // Paper - Add SpawnReason
mob.playAmbientSound();
}
}