Package noppes.npcs.api
Interface IWorld
public interface IWorld
-
Method Summary
Modifier and Type Method Description void
broadcast(java.lang.String message)
IEntity
createEntity(java.lang.String id)
IEntity
createEntityFromNBT(INbt nbt)
IItemStack
createItem(java.lang.String name, int damage, int size)
IItemStack
createItemFromNbt(INbt nbt)
void
explode(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[]
getAllPlayers()
java.lang.String
getBiomeName(int x, int z)
IBlock
getBlock(int x, int y, int z)
IEntity
getClone(int tab, java.lang.String name)
Deprecated.IEntity
getClosestEntity(int x, int y, int z, int range, int type)
Deprecated.IEntity
getClosestEntity(IPos pos, int range, int type)
IDimension
getDimension()
IEntity
getEntity(java.lang.String uuid)
float
getLightValue(int x, int y, int z)
net.minecraft.util.math.BlockPos
getMCBlockPos(int x, int y, int z)
Expert users onlynet.minecraft.world.WorldServer
getMCWorld()
Expert users onlyjava.lang.String
getName()
IEntity[]
getNearbyEntities(int x, int y, int z, int range, int type)
Deprecated.IEntity[]
getNearbyEntities(IPos pos, int range, int type)
IPlayer
getPlayer(java.lang.String name)
int
getRedstonePower(int x, int y, int z)
IScoreboard
getScoreboard()
IBlock
getSpawnPoint()
IData
getStoreddata()
Stored data persists through world restart.IData
getTempdata()
Stores any type of data, but will be gone on restart Temp data is the same cross dimensionlong
getTime()
long
getTotalTime()
boolean
isDay()
boolean
isRaining()
void
playSoundAt(IPos pos, java.lang.String sound, float volume, float pitch)
Sound will be played in a 16 block rangevoid
removeBlock(int x, int y, int z)
void
setBlock(int x, int y, int z, java.lang.String name, int meta)
void
setRaining(boolean bo)
void
setSpawnPoint(IBlock block)
void
setTime(long time)
IEntity
spawnClone(double x, double y, double z, int tab, java.lang.String name)
Deprecated.void
spawnEntity(IEntity entity)
void
spawnParticle(java.lang.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.void
thunderStrike(double x, double y, double z)
-
Method Details
-
getNearbyEntities
Deprecated. -
getNearbyEntities
-
getClosestEntity
Deprecated. -
getClosestEntity
-
getAllEntities
This gets all currently loaded entities in a world- Parameters:
type
-EntityType
}- 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
- Returns:
- The block at the given position. Returns null if there isn't a block
-
setBlock
void setBlock(int x, int y, int z, java.lang.String name, int meta) -
removeBlock
void removeBlock(int x, int y, int z) -
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(java.lang.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
void broadcast(java.lang.String message) -
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
java.lang.String getBiomeName(int x, int z) -
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
-
getMCWorld
net.minecraft.world.WorldServer getMCWorld()Expert users only- Returns:
- Returns minecrafts world
-
getMCBlockPos
net.minecraft.util.math.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
java.lang.String getName()
-