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 ICustomGuicreateCustomGui(int id, int width, int height, boolean pauseGame, IPlayer player) abstract IPlayerMailcreateMail(String sender, String subject) abstract ICustomNpccreateNPC(net.minecraft.world.level.Level world) Doesnt spawn the npc in the worldabstract IOverlaycreateOverlay(int id) abstract net.minecraftforge.eventbus.api.IEventBusevents()Used by moddersabstract StringexecuteCommand(IWorld world, String command) abstract ICloneHandlerabstract IDialogHandlerabstract IFactionHandlerabstract Fileabstract IBlockgetIBlock(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) abstract IContainergetIContainer(net.minecraft.world.Container container) abstract IContainergetIContainer(net.minecraft.world.inventory.AbstractContainerMenu container) abstract IDamageSourcegetIDamageSource(net.minecraft.world.damagesource.DamageSource damagesource) abstract IEntitygetIEntity(net.minecraft.world.entity.Entity entity) abstract IItemStackgetIItemStack(net.minecraft.world.item.ItemStack itemstack) abstract INbtgetINbt(net.minecraft.nbt.CompoundTag compound) abstract IPosgetIPos(double x, double y, double z) abstract IWorldabstract IWorldgetIWorld(net.minecraft.server.level.ServerLevel world) abstract IWorldgetIWorld(net.minecraft.world.level.dimension.DimensionType dimension) abstract IWorld[]abstract Fileabstract IQuestHandlerabstract StringgetRandomName(int dictionary, int gender) abstract INbtgetRawPlayerData(String uuid) Get player data even if they are offlineabstract IRecipeHandlerabstract booleanhasPermissionNode(String permission) static NpcAPIInstance()static booleanabstract ICustomNpcspawnNPC(net.minecraft.world.level.Level level, int x, int y, int z) Creates and spawns an npcabstract INbtstringToNbt(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
-