Repository navigation
Level
benjamin edited this page Feb 26, 2018
·
3 revisions
function Level.destroyBlock(x, y, z, shouldDrop);
- Destroys a block as if a player destroyed it.
function Level.dropItem(x, y, z, range, id, count, damage);
- Drops an item onto the floor. You can set a range in which it randomly appears (0 for spawning at the exact coordinates)
function Level.explode(x, y, z, radius);
- Triggers a TNT explosion at the given coordinates. The standart radius is 5.
function Level.getAddress();
- ???
function Level.getBrightness(x, y, z);
- Returns the brightness in a certain area in the world.
function Level.getChestSlot(x, y, z, slot);
- Returns the ID of an item in a chest slot.
function Level.getChestSlotCount(x, y, z, slot);
- Returns the count of an item in a chest slot.
function Level.getChestSlotData(x, y, z, slot);
- Returns the damage of an item in a chest slot.
function Level.getData(x, y, z);
- Returns the damage of a block in the world.
function Level.getFurnaceSlot(x, y, z, slot);
- Returns the ID of an item in a furnace.
###getFurnaceSlotCount
function Level.getFurnaceSlotCount(x, y, z, slot);
- Returns the count of an item in a furnace.
function Level.getFurnaceSlotData(x, y, z, slot);
- Returns the damage of an item in a furnace.
function Level.getGameMode();
- Returns the gamemode for the level, 1 for creative, 0 for survival.
function Level.getSignText(x, y, z, line);
- Changes the Text of a sign
function Level.getTile(x, y, z);
- Returns the id of the block at the given coordinates.
function Level.getTime();
- Returns the current daytime as a number.
function Level.getWorldDir();
- Returns the folder-path the current world is saved in.
function Level.getWorldName();
- Returns the name of the current world as a string.
function Level.playSound(x, y, z, sound, volume, pitch);
- Plays a sound from the game like an item breaking or an animal.
function Level.playSoundEnt(entity, sound, volume, pitch);
- Plays a sound at the position of an entity and adjusts the volume as the player moves closer or further away from the entity.
function Level.setChestSlot(x, y, z, slot, id, damage, count);
- Changes the content of a chest in the given slot. Remember to start counting at 0.
function Level.setFurnaceSlot(x, y, z, slot, id, damage, count);
- It's like setChestSlot but with furnaces
function Level.function(gamemode);
- Changes the players gamemode (0 for survival and 1 for creative).
function Level.setNightMode(isNight);
- Sets the daytime to night (1 for night and 0 for day);
function Level.setSignText(x, y, z, line, text);
- Changes the text of a sign. please use the lines parameter instead of \n.
function Level.setSpawn(x, y, z);
- Sets the respawn position of the player just like a bed.
function Level.setTile(x, y, z, id, damage);
- Places a block at the given coordinates with a specified id and data index
function Level.setTime(time);
- Sets the daytime.
function Level.spawnChicken(x, y, z, skin);
- Spawns a chicken. The skin parameter is optional.
function Level.spawnCow(x, y, z, skin);
- Spawns a cow. The skin parameter is optional.
function Level.spawnMob(x, y, z, typeId, skin);
- Spawns a mob (basically everything that's not solid blocks, including projectiles and burning tnt).
Level.destroyBlock(x, y, z, shouldDrop);
Level.dropItem(x, y, z, range, id, count, damage);
Level.explode(x, y, z, radius);
Level.getAddress();
Level.getBrightness(x, y, z);
Level.getChestSlot(x, y, z, slot);
Level.getChestSlotCount(x, y, z, slot);
Level.getChestSlotData(x, y, z, slot);
Level.getData(x, y, z);
Level.getFurnaceSlot(x, y, z, slot);
Level.getFurnaceSlotCount(x, y, z, slot);
Level.getFurnaceSlotData(x, y, z, slot);
Level.getGameMode();
Level.getSignText(x, y, z, line);
Level.getTile(x, y, z);
Level.getTime();
Level.getWorldDir();
Level.getWorldName();
Level.playSound(x, y, z, sound, volume, pitch);
Level.playSoundEnt(entity, sound, volume, pitch);
Level.setChestSlot(x, y, z, slot, id, damage, count);
Level.setFurnaceSlot(x, y, z, slot, id, damage, count);
Level.setGameMode(gamemode);
Level.setNightMode(isNight);
Level.setSignText(x, y, z, line, text);
Level.setSpawn(x, y, z);
Level.setTile(x, y, z, id, damage);
Level.setTime(time);
Level.spawnChicken(x, y, z, skin);
Level.spawnCow(x, y, z, skin);
Level.spawnMob(x, y, z, typeId, skin);