mirror of
https://github.com/GayPizzaSpecifications/foundation.git
synced 2025-08-03 13:31:32 +00:00
Persist all entities that have been leashed.
This commit is contained in:
@ -69,8 +69,10 @@ class GameplayFeature : Feature() {
|
|||||||
// Something to do with Bukkit, leashes must happen after the event.
|
// Something to do with Bukkit, leashes must happen after the event.
|
||||||
Bukkit.getScheduler().runTask(plugin) { ->
|
Bukkit.getScheduler().runTask(plugin) { ->
|
||||||
// If the entity is already leashed, don't do anything.
|
// If the entity is already leashed, don't do anything.
|
||||||
if (livingEntity.isLeashed
|
if (livingEntity.isLeashed) return@runTask
|
||||||
) return@runTask
|
|
||||||
|
// Interacted with the entity, don't despawn it.
|
||||||
|
livingEntity.removeWhenFarAway = false
|
||||||
|
|
||||||
val leashSuccess = livingEntity.setLeashHolder(event.player)
|
val leashSuccess = livingEntity.setLeashHolder(event.player)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user