mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-17 21:35:13 +00:00
Entity API Documentation
This commit is contained in:
1 parent
3593a09d1d
commit
8c2c226d34
21 files changed
+2778
-1142
No files matched your search
@@ -1,51 +1,157 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
|
||||
public interface IEntityLiving<T extends EntityLiving> extends IEntityLivingBase<T> {
|
||||
boolean isNavigating();
|
||||
|
||||
void clearNavigation();
|
||||
|
||||
void navigateTo(double var1, double var3, double var5, double var7);
|
||||
|
||||
T getMCEntity();
|
||||
|
||||
void playLivingSound();
|
||||
|
||||
void spawnExplosionParticle();
|
||||
|
||||
void setMoveForward(float speed);
|
||||
|
||||
void faceEntity(IEntity entity, float pitch, float yaw);
|
||||
|
||||
boolean canPickUpLoot();
|
||||
|
||||
void setCanPickUpLoot(boolean pickUp);
|
||||
|
||||
boolean isPersistent();
|
||||
|
||||
void enablePersistence();
|
||||
|
||||
void setCustomNameTag(String text);
|
||||
|
||||
String getCustomNameTag();
|
||||
|
||||
boolean hasCustomNameTag();
|
||||
|
||||
void setAlwaysRenderNameTag(boolean alwaysRender);
|
||||
|
||||
boolean getAlwaysRenderNameTag();
|
||||
|
||||
void clearLeashed(boolean sendPacket, boolean dropLeash);
|
||||
|
||||
boolean allowLeashing();
|
||||
|
||||
boolean getLeashed();
|
||||
|
||||
IEntity getLeashedTo();
|
||||
|
||||
void setLeashedTo(IEntity entity, boolean sendPacket);
|
||||
|
||||
boolean canBeSteered();
|
||||
}
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import noppes.npcs.api.entity.IEntityLivingBase;
|
||||
|
||||
/**
|
||||
* Represents a living entity (mob, NPC, etc.) that extends the base living functionality.
|
||||
* Provides additional methods for navigation, sound, custom name, leashing, and more.
|
||||
*
|
||||
* @param <T> The underlying Minecraft EntityLiving type.
|
||||
*/
|
||||
public interface IEntityLiving<T extends EntityLiving> extends IEntityLivingBase<T> {
|
||||
|
||||
/**
|
||||
* Checks if the entity is currently navigating (pathfinding).
|
||||
*
|
||||
* @return true if navigating; false otherwise.
|
||||
*/
|
||||
boolean isNavigating();
|
||||
|
||||
/**
|
||||
* Clears the current navigation path.
|
||||
*/
|
||||
void clearNavigation();
|
||||
|
||||
/**
|
||||
* Commands the entity to navigate toward the specified destination.
|
||||
*
|
||||
* @param x Destination x coordinate.
|
||||
* @param y Destination y coordinate.
|
||||
* @param z Destination z coordinate.
|
||||
* @param speed Movement speed (0.7 is default).
|
||||
*/
|
||||
void navigateTo(double x, double y, double z, double speed);
|
||||
|
||||
/**
|
||||
* Returns the underlying Minecraft entity.
|
||||
*
|
||||
* @return the Minecraft entity.
|
||||
*/
|
||||
T getMCEntity();
|
||||
|
||||
/**
|
||||
* Plays the entity's living sound.
|
||||
*/
|
||||
void playLivingSound();
|
||||
|
||||
/**
|
||||
* Spawns explosion particles for this entity.
|
||||
*/
|
||||
void spawnExplosionParticle();
|
||||
|
||||
/**
|
||||
* Sets the forward movement speed for the entity.
|
||||
*
|
||||
* @param speed the forward speed.
|
||||
*/
|
||||
void setMoveForward(float speed);
|
||||
|
||||
/**
|
||||
* Rotates the entity to face the given entity.
|
||||
*
|
||||
* @param entity the target entity.
|
||||
* @param pitch the pitch angle.
|
||||
* @param yaw the yaw angle.
|
||||
*/
|
||||
void faceEntity(IEntity entity, float pitch, float yaw);
|
||||
|
||||
/**
|
||||
* @return Whether the entity can pick up loot.
|
||||
*/
|
||||
boolean canPickUpLoot();
|
||||
|
||||
/**
|
||||
* Sets whether the entity can pick up loot.
|
||||
*
|
||||
* @param pickUp true to allow picking up loot.
|
||||
*/
|
||||
void setCanPickUpLoot(boolean pickUp);
|
||||
|
||||
/**
|
||||
* @return Whether the entity is persistent (won't despawn).
|
||||
*/
|
||||
boolean isPersistent();
|
||||
|
||||
/**
|
||||
* Enables persistence so that the entity does not despawn.
|
||||
*/
|
||||
void enablePersistence();
|
||||
|
||||
/**
|
||||
* Sets a custom name tag for the entity.
|
||||
*
|
||||
* @param text the custom name.
|
||||
*/
|
||||
void setCustomNameTag(String text);
|
||||
|
||||
/**
|
||||
* Returns the entity's custom name tag.
|
||||
*
|
||||
* @return the custom name.
|
||||
*/
|
||||
String getCustomNameTag();
|
||||
|
||||
/**
|
||||
* @return Whether the entity has a custom name tag.
|
||||
*/
|
||||
boolean hasCustomNameTag();
|
||||
|
||||
/**
|
||||
* Sets whether the entity's name tag is always rendered.
|
||||
*
|
||||
* @param alwaysRender true to always render the name tag.
|
||||
*/
|
||||
void setAlwaysRenderNameTag(boolean alwaysRender);
|
||||
|
||||
/**
|
||||
* @return Whether the name tag is always rendered.
|
||||
*/
|
||||
boolean getAlwaysRenderNameTag();
|
||||
|
||||
/**
|
||||
* Clears the entity's leash.
|
||||
*
|
||||
* @param sendPacket whether to send a packet update.
|
||||
* @param dropLeash whether to drop the leash item.
|
||||
*/
|
||||
void clearLeashed(boolean sendPacket, boolean dropLeash);
|
||||
|
||||
/**
|
||||
* @return Whether the entity allows leashing.
|
||||
*/
|
||||
boolean allowLeashing();
|
||||
|
||||
/**
|
||||
* @return Whether the entity is currently leashed.
|
||||
*/
|
||||
boolean getLeashed();
|
||||
|
||||
/**
|
||||
* @return The entity to which this entity is leashed.
|
||||
*/
|
||||
IEntity getLeashedTo();
|
||||
|
||||
/**
|
||||
* Leashes this entity to the specified entity.
|
||||
*
|
||||
* @param entity the entity to leash to.
|
||||
* @param sendPacket whether to send a packet update.
|
||||
*/
|
||||
void setLeashedTo(IEntity entity, boolean sendPacket);
|
||||
|
||||
/**
|
||||
* @return Whether the entity can be steered.
|
||||
*/
|
||||
boolean canBeSteered();
|
||||
}
|
||||
Reference in new issue
Block a user