minecraft-src/net/minecraft/world/entity/OwnableEntity.java
2025-07-04 01:41:11 +03:00

18 lines
395 B
Java

package net.minecraft.world.entity;
import java.util.UUID;
import net.minecraft.world.level.EntityGetter;
import org.jetbrains.annotations.Nullable;
public interface OwnableEntity {
@Nullable
UUID getOwnerUUID();
EntityGetter level();
@Nullable
default LivingEntity getOwner() {
UUID uUID = this.getOwnerUUID();
return uUID == null ? null : this.level().getPlayerByUUID(uUID);
}
}