mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 20:23:53 -07:00
Added entity.playEffect, thanks to main-- in an (unfortunately old) PR.
By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
54
paper-api/src/main/java/org/bukkit/EntityEffect.java
Normal file
54
paper-api/src/main/java/org/bukkit/EntityEffect.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package org.bukkit;
|
||||
|
||||
/**
|
||||
* A list of all Effects that can happen to entities.
|
||||
*/
|
||||
public enum EntityEffect {
|
||||
|
||||
/**
|
||||
* When mobs get hurt.
|
||||
*/
|
||||
HURT((byte) 2),
|
||||
|
||||
/**
|
||||
* When a mob dies.
|
||||
* <p>
|
||||
* <b>This will cause client-glitches!
|
||||
*/
|
||||
DEATH((byte) 3),
|
||||
|
||||
/**
|
||||
* The smoke when taming a wolf fails.
|
||||
* <p>
|
||||
* Without client-mods this will be ignored if the entity is not a wolf.
|
||||
*/
|
||||
WOLF_SMOKE((byte) 6),
|
||||
|
||||
/**
|
||||
* The hearts when taming a wolf succeeds.
|
||||
* <p>
|
||||
* Without client-mods this will be ignored if the entity is not a wolf.
|
||||
*/
|
||||
WOLF_HEARTS((byte) 7),
|
||||
|
||||
/**
|
||||
* When a wolf shakes (after being wet).
|
||||
* <p>
|
||||
* Without client-mods this will be ignored if the entity is not a wolf.
|
||||
*/
|
||||
WOLF_SHAKE((byte) 8);
|
||||
|
||||
private final byte data;
|
||||
|
||||
EntityEffect(byte data)
|
||||
{
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The data-value that is sent to the client to play this effect.
|
||||
*/
|
||||
public byte getData() {
|
||||
return data;
|
||||
}
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.EntityEffect;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
@@ -216,4 +217,13 @@ public interface Entity {
|
||||
* @param value Age of entity
|
||||
*/
|
||||
public void setTicksLived(int value);
|
||||
|
||||
/**
|
||||
* Performs the specified {@link EntityEffect} for this entity.
|
||||
* <p>
|
||||
* This will be viewable to all players near the entity.
|
||||
*
|
||||
* @param type Effect to play.
|
||||
*/
|
||||
public void playEffect(EntityEffect type);
|
||||
}
|
||||
|
Reference in New Issue
Block a user