Package noppes.npcs.api
Interface IWorld
public interface IWorld
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreateEntity(String id) createEntityFromNBT(INbt nbt) createItem(String name, int size) createItemFromNbt(INbt nbt) voidexplode(double x, double y, double z, float range, boolean fire, boolean grief) IEntity[]getAllEntities(int type) This gets all currently loaded entities in a worldIPlayer[]getBiomeName(int x, int z) getBlock(int x, int y, int z) Deprecated.Deprecated.getClosestEntity(int x, int y, int z, int range, int type) Deprecated.getClosestEntity(IPos pos, int range, int type) floatgetLightValue(int x, int y, int z) net.minecraft.core.BlockPosgetMCBlockPos(int x, int y, int z) Expert users onlynet.minecraft.server.level.ServerLevelExpert users onlygetName()IEntity[]getNearbyEntities(int x, int y, int z, int range, int type) Deprecated.IEntity[]getNearbyEntities(IPos pos, int range, int type) intgetRedstonePower(int x, int y, int z) Stored data persists through world restart.Stores any type of data, but will be gone on restart Temp data is the same cross dimensionlonggetTime()longbooleanisDay()booleanvoidplaySoundAt(IPos pos, String sound, float volume, float pitch) Sound will be played in a 16 block rangevoidremoveBlock(int x, int y, int z) Deprecated.voidremoveBlock(IPos pos) voidDeprecated.metadata nolonger existsvoidsetRaining(boolean bo) voidsetSpawnPoint(IBlock block) voidsetTime(long time) spawnClone(double x, double y, double z, int tab, String name) Deprecated.voidspawnEntity(IEntity entity) voidspawnParticle(String particle, double x, double y, double z, double dx, double dy, double dz, double speed, int count) Sends a packet from the server to the client everytime its called.voidthunderStrike(double x, double y, double z) voidFires trigger event for forge scripts
-
Method Details
-
getNearbyEntities
Deprecated. -
getNearbyEntities
-
getClosestEntity
Deprecated. -
getClosestEntity
-
getAllEntities
This gets all currently loaded entities in a world- Parameters:
type-EntitiesType}- Returns:
- An array of all entities
-
getTime
long getTime()- Returns:
- The world time
-
setTime
void setTime(long time) -
getTotalTime
long getTotalTime()- Returns:
- The total world time (doesn't change with the /time set command
-
getBlock
Deprecated. -
getBlock
- Returns:
- The block at the given position. Returns null if there isn't a block
-
setBlock
Deprecated.metadata nolonger exists -
setBlock
-
removeBlock
void removeBlock(int x, int y, int z) Deprecated. -
removeBlock
-
getLightValue
float getLightValue(int x, int y, int z) - Returns:
- Returns a value between 0 and 1
-
getPlayer
- Parameters:
name- The name of the player to be returned- Returns:
- The Player with name. Null is returned when the player isnt found
-
isDay
boolean isDay() -
isRaining
boolean isRaining() -
getDimension
IDimension getDimension() -
setRaining
void setRaining(boolean bo) -
thunderStrike
void thunderStrike(double x, double y, double z) -
playSoundAt
Sound will be played in a 16 block range- Parameters:
pos- Pos at which to playsound- Sound resource namevolume- default 1pitch- default 1
-
spawnParticle
void spawnParticle(String particle, double x, double y, double z, double dx, double dy, double dz, double speed, int count) Sends a packet from the server to the client everytime its called. Probably should not use this too much.- Parameters:
particle- Particle name. Particle name list: http://minecraft.gamepedia.com/Particlesx- The x positiony- The y positionz- The z positiondx- Usually used for the x motiondy- Usually used for the y motiondz- Usually used for the z motionspeed- Speed of the particles, usually between 0 and 1count- Particle count
-
broadcast
-
getScoreboard
IScoreboard getScoreboard() -
getTempdata
IData getTempdata()Stores any type of data, but will be gone on restart Temp data is the same cross dimension -
getStoreddata
IData getStoreddata()Stored data persists through world restart. Unlike tempdata only Strings and Numbers can be saved. Stored data is the same cross dimension -
createItem
-
createItemFromNbt
-
explode
void explode(double x, double y, double z, float range, boolean fire, boolean grief) - Parameters:
x- Position xy- Position yz- Position zrange- Range of the explosionfire- Whether or not the explosion does fire damagegrief- Whether or not the explosion does damage to blocks
-
getAllPlayers
IPlayer[] getAllPlayers() -
getBiomeName
-
spawnEntity
-
spawnClone
Deprecated.Depricated, use the API.clones.spawn instead -
getClone
Deprecated.Depricated, use the API.clones.get instead -
getRedstonePower
int getRedstonePower(int x, int y, int z) - Returns:
- value between 0 and 16
-
getMCLevel
net.minecraft.server.level.ServerLevel getMCLevel()Expert users only- Returns:
- Returns minecrafts world
-
getMCBlockPos
net.minecraft.core.BlockPos getMCBlockPos(int x, int y, int z) Expert users only- Returns:
- Returns minecraft BlockPos object
-
getEntity
- Parameters:
uuid- entity uuid- Returns:
- Returns entity based on uuid
-
createEntityFromNBT
-
createEntity
-
getSpawnPoint
IBlock getSpawnPoint() -
setSpawnPoint
-
getName
String getName() -
trigger
Fires trigger event for forge scripts- Parameters:
id- , Id for the eventarguments- , arguments you can give with it
-