All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minestom.server.event.trait.EntityInstanceEvent Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
package net.minestom.server.event.trait;

import net.minestom.server.entity.Entity;
import net.minestom.server.instance.Instance;
import org.jetbrains.annotations.NotNull;

/**
 * Represents an {@link EntityEvent} which happen in {@link Entity#getInstance()}.
 * Useful if you need to listen to entity events happening in its instance.
 * 

* Be aware that the entity's instance must be non-null. */ public interface EntityInstanceEvent extends EntityEvent, InstanceEvent { @Override default @NotNull Instance getInstance() { final Instance instance = getEntity().getInstance(); assert instance != null : "EntityInstanceEvent is only supported on events where the entity's instance is non-null!"; return instance; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy