Package noppes.npcs.api.entity
Interface ICustomNpc<T extends net.minecraft.world.entity.Mob>
- All Superinterfaces:
IEntity<T>
,IEntityLiving<T>
,IMob<T>
-
Method Summary
Modifier and TypeMethodDescriptionexecuteCommand
(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]getAi()
getDialog
(int slot) int
getHomeX()
int
getHomeY()
int
getHomeZ()
getJob()
getOwner()
getRole()
getStats()
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
void
void
void
setFaction
(int id) void
setHome
(int x, int y, int z) shootItem
(double x, double y, double z, IItemStack item, int accuracy) shootItem
(IEntityLiving target, IItemStack item, int accuracy) void
Fires trigger event for npc scriptsvoid
Force update client.Methods inherited from interface noppes.npcs.api.entity.IEntity
addRider, addTag, clearRiders, damage, 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
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
Methods inherited from interface noppes.npcs.api.entity.IMob
clearNavigation, getMCEntity, getNavigationPath, isNavigating, jump, navigateTo
-
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
IEntityLiving 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
-
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
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
-
trigger
Fires trigger event for npc scripts- Parameters:
id
- , Id for the eventarguments
- , arguments you can give with it
-