Package noppes.npcs.api
Class NpcAPI
java.lang.Object
noppes.npcs.api.NpcAPI
Note this API should only be used Server side not on the client
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ICustomGui
createCustomGui
(int id, int width, int height, boolean pauseGame, IPlayer player) abstract IPlayerMail
createMail
(String sender, String subject) abstract ICustomNpc
createNPC
(net.minecraft.world.level.Level world) Doesnt spawn the npc in the worldabstract IOverlay
createOverlay
(int id) abstract net.minecraftforge.eventbus.api.IEventBus
events()
Used by moddersabstract String
executeCommand
(IWorld world, String command) abstract ICloneHandler
abstract IDialogHandler
abstract IFactionHandler
abstract File
abstract IBlock
getIBlock
(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) abstract IContainer
getIContainer
(net.minecraft.world.Container container) abstract IContainer
getIContainer
(net.minecraft.world.inventory.AbstractContainerMenu container) abstract IDamageSource
getIDamageSource
(net.minecraft.world.damagesource.DamageSource damagesource) abstract IEntity
getIEntity
(net.minecraft.world.entity.Entity entity) abstract IItemStack
getIItemStack
(net.minecraft.world.item.ItemStack itemstack) abstract INbt
getINbt
(net.minecraft.nbt.CompoundTag compound) abstract IPos
getIPos
(double x, double y, double z) abstract IWorld
abstract IWorld
getIWorld
(net.minecraft.server.level.ServerLevel world) abstract IWorld
getIWorld
(net.minecraft.world.level.dimension.DimensionType dimension) abstract IWorld[]
abstract File
abstract IQuestHandler
abstract String
getRandomName
(int dictionary, int gender) abstract INbt
getRawPlayerData
(String uuid) Get player data even if they are offlineabstract IRecipeHandler
abstract boolean
hasPermissionNode
(String permission) static NpcAPI
Instance()
static boolean
abstract ICustomNpc
spawnNPC
(net.minecraft.world.level.Level level, int x, int y, int z) Creates and spawns an npcabstract INbt
stringToNbt
(String str)
-
Constructor Details
-
NpcAPI
public NpcAPI()
-
-
Method Details
-
createNPC
Doesnt spawn the npc in the world -
spawnNPC
Creates and spawns an npc -
getIEntity
-
getIBlock
public abstract IBlock getIBlock(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) -
getIContainer
-
getIContainer
public abstract IContainer getIContainer(net.minecraft.world.inventory.AbstractContainerMenu container) -
getIItemStack
-
getIWorld
-
getIWorld
- Parameters:
dimension
- 'minecraft:overworld', 'minecraft:the_nether', 'minecraft:the_end'
-
getIWorld
-
getIWorlds
-
getINbt
-
getIPos
-
getFactions
-
getRecipes
-
getQuests
-
getDialogs
-
getClones
-
getIDamageSource
public abstract IDamageSource getIDamageSource(net.minecraft.world.damagesource.DamageSource damagesource) -
stringToNbt
-
createMail
-
createCustomGui
public abstract ICustomGui createCustomGui(int id, int width, int height, boolean pauseGame, IPlayer player) -
createOverlay
-
getRawPlayerData
Get player data even if they are offline- Parameters:
uuid
-- Returns:
-
events
public abstract net.minecraftforge.eventbus.api.IEventBus events()Used by modders- Returns:
- The event bus where you register CustomNPCEvents
-
getGlobalDir
- Returns:
- Returns the .minecraft/customnpcs folder or [yourserverfolder]/customnpcs
-
getLevelDir
- Returns:
- Returns the .minecraft/saves/[yourworld]/customnpcs folder or [yourserverfolder]/[yourworld]/customnpcs
-
IsAvailable
public static boolean IsAvailable() -
Instance
-
hasPermissionNode
-
executeCommand
- Parameters:
world
- The world in which the command is executedcommand
- The Command to execute- Returns:
-
getRandomName
- Parameters:
dictionary
- 0:roman, 1:japanese, 2:slavic, 3:welsh, 4:saami, 5:old-norse, 6:ancient-greek, 7:aztec, 8:classic-cnpcs, 9:spanishgender
- 0:random, 1:male, 2:female- Returns:
- Returns a randomly generated name
-