Package noppes.npcs.api.entity
Interface ICustomNpc<T extends net.minecraft.entity.EntityCreature>
- All Superinterfaces:
IEntity<T>
,IEntityLiving<T>
,IEntityLivingBase<T>
public interface ICustomNpc<T extends net.minecraft.entity.EntityCreature> extends IEntityLiving<T>
-
Method Summary
Modifier and Type Method Description java.lang.String
executeCommand(java.lang.String command)
On servers the enable-command-block option in the server.properties needs to be set to true
Use /gamerule commandBlockOutput false/true to turn off/on command block feedback
Setting NpcUseOpCommands to true in the CustomNPCs.cfg should allow the npc to run op commands, be warned this could be a major security risk, use at own risk
For permission plugins the commands are run under uuid:c9c843f8-4cb1-4c82-aa61-e264291b7bd6 and name:[customnpcs]INPCAdvanced
getAdvanced()
INPCAi
getAi()
IDialog
getDialog(int slot)
INPCDisplay
getDisplay()
IFaction
getFaction()
int
getHomeX()
int
getHomeY()
int
getHomeZ()
INPCInventory
getInventory()
INPCJob
getJob()
IEntityLivingBase
getOwner()
INPCRole
getRole()
INPCStats
getStats()
ITimers
getTimers()
void
giveItem(IPlayer player, IItemStack item)
If the player can't carry the item it will fall on the ground.void
reset()
Basically completely resets the npc.void
say(java.lang.String message)
void
sayTo(IPlayer player, java.lang.String message)
void
setDialog(int slot, IDialog dialog)
void
setFaction(int id)
void
setHome(int x, int y, int z)
IProjectile
shootItem(double x, double y, double z, IItemStack item, int accuracy)
IProjectile
shootItem(IEntityLivingBase target, IItemStack item, int accuracy)
void
updateClient()
Force update client.Methods inherited from interface noppes.npcs.api.entity.IEntity
addRider, addTag, clearRiders, damage, despawn, dropItem, extinguish, generateNewUUID, getAge, getAllRiders, getBlockX, getBlockY, getBlockZ, getEntityName, getEntityNbt, getEyeHeight, getHeight, getMotionX, getMotionY, getMotionZ, getMount, getName, getNbt, getPitch, getPos, getRiders, getRotation, getStoreddata, getTags, getTempdata, getType, getTypeName, getUUID, getWidth, getWorld, getX, getY, getZ, hasCustomName, hasTag, inFire, inLava, inWater, isAlive, isBurning, isSneaking, isSprinting, kill, knockback, playAnimation, rayTraceBlock, rayTraceEntities, removeTag, setBurning, setEntityNbt, setMotionX, setMotionY, setMotionZ, setMount, setName, setPitch, setPos, setPosition, setRotation, setX, setY, setZ, spawn, storeAsClone, typeOf
Methods inherited from interface noppes.npcs.api.entity.IEntityLiving
clearNavigation, getMCEntity, getNavigationPath, isNavigating, jump, navigateTo
Methods inherited from interface noppes.npcs.api.entity.IEntityLivingBase
addMark, addPotionEffect, canSeeEntity, clearPotionEffects, getArmor, getAttackTarget, getHealth, getLastAttacked, getLastAttackedTime, getMainhandItem, getMarks, getMaxHealth, getMoveForward, getMoveStrafing, getMoveVertical, getOffhandItem, getPotionEffect, isAttacking, isChild, removeMark, setArmor, setAttackTarget, setHealth, setMainhandItem, setMaxHealth, setMoveForward, setMoveStrafing, setMoveVertical, setOffhandItem, swingMainhand, swingOffhand
-
Method Details
-
getDisplay
INPCDisplay getDisplay() -
getInventory
INPCInventory getInventory() -
getStats
INPCStats getStats() -
getAi
INPCAi getAi() -
getAdvanced
INPCAdvanced getAdvanced() -
getFaction
IFaction getFaction() -
setFaction
void setFaction(int id) -
getRole
INPCRole getRole() -
getJob
INPCJob getJob() -
getTimers
ITimers getTimers() -
getHomeX
int getHomeX() -
getHomeY
int getHomeY() -
getHomeZ
int getHomeZ() -
getOwner
IEntityLivingBase getOwner()- Returns:
- Incase the npc is a Follower or Companion it will return the one who its following. Also works for scene followers
-
setHome
void setHome(int x, int y, int z) -
reset
void reset()Basically completely resets the npc. This will also call the Init script -
say
void say(java.lang.String message) -
sayTo
-
shootItem
- Parameters:
item
- The item you want to shootaccuracy
- Accuracy of the shot (1-100)
-
shootItem
- Parameters:
item
- The item you want to shootaccuracy
- Accuracy of the shot (1-100)- Returns:
-
giveItem
If the player can't carry the item it will fall on the ground. (unless the player is in creative) -
setDialog
- Parameters:
slot
- (0-11)
-
getDialog
- Parameters:
slot
- (0-11)
-
updateClient
void updateClient()Force update client. Normally it updates client once every 10 ticks -
executeCommand
java.lang.String executeCommand(java.lang.String command)On servers the enable-command-block option in the server.properties needs to be set to true
Use /gamerule commandBlockOutput false/true to turn off/on command block feedback
Setting NpcUseOpCommands to true in the CustomNPCs.cfg should allow the npc to run op commands, be warned this could be a major security risk, use at own risk
For permission plugins the commands are run under uuid:c9c843f8-4cb1-4c82-aa61-e264291b7bd6 and name:[customnpcs]- Parameters:
command
- The command to be executed- Returns:
- Returns the commands output
-