I assume this will dump the internal variable table to either a string as-is or to a file specified by the string variable... I haven't needed to use this so I don't know.
--
ModPE.getBytesFromTexturePack(par1String);
I assume this returns a string from the data contained in the texture pack... Never tried it, might never use it.
--
ModPE.getI18n(par1String);
Gets the translated name of a variable in the current language?
--
ModPE.getLanguage();
This one is easy. Returns a string representing the current language code in use.
--
ModPE.getMinecraftVersion();
Returns the current Minecraft version of the game itself.
--
ModPE.langEdit(option, data);
Set the identifier string option to be the value of string data.
--
ModPE.leaveGame();
Exits the current single player or multiplayer game you are in.
--
ModPE.log(message);
I would assume this logs the message to the system log.
--
ModPE.openInputStreamFromTexturePack(path);
Returns an InputStream for reading. It uses path for the location.
Level.addParticle(particleType, x, y, z, velX, velY, velZ, par8int);
Adds particleType particles at the specifed location and velocity. (Is the last one the size? It is an integer!)
--
Level.biomeIdToName(biomeId);
Returns the name of the specified biome by the numeric biomeId.
--
Level.canSeeSky(x, y, z);
I assume this is similar to the check if a PC-version beacon can produce its beam. "Does this coordinate have access to the sky?"
--
Level.destroyBlock(x, y, z, doNormalDrop);
Destroys the block at the specified coordinates. Be careful of using it at the same coordinates for the destroyBlock hook.
--
Level.dropItem(x, y, z, range, id, count, damage);
Creates one or more dropped item at the specified coordinates and range.
--
Level.explode(x, y, z, radius, onFire);
Causes an explosion at the specified location and radius. onFire specifies if it summons fire blocks (the ones that cling to wood-like objects and burn them).
--
Level.getAddress();
I guess this might be broken as well?
--
Level.getBiome(x, z);
Returns the biome ID at the specified x and z coordinates. Biomes typically didn't factor in the Y coordinate yet.
--
Level.getBiomeName(x, z);
Returns the biome name at the specified x and z coordinates.
--
Level.getBrightness(x, y, z);
Returns the current brightness at the specified location. Return values should be between 0 and 15 inclusive.
--
Level.getChestSlot(x, y, z, slot);
Returns the ID of the item in the slot slot in the chest block located at the specified coordinates.
--
Level.getChestSlotCount(x, y, z, slot);
Returns the count of the item in the slot slot in the chest block located at the specified coordinates.
--
Level.getChestSlotCustomName(x, y, z, slot);
Returns the customized name of the item in the slot slot in the chest block located at the specified coordinates.
--
Level.getChestSlotData(x, y, z, slot);
Returns the data/damage value of the item in the slot slot in the chest block located at the specified coordinates.
--
Level.getData(x, y, z);
Returns the data/damage value of the block at the specified coordinates.
--
Level.getDifficulty();
Returns the current difficulty as a number. 0=peaceful, 1=easy, ...
--
Level.getFurnaceSlot(x, y, z, slot);
Returns the ID of the item in the slot slot in the furnace located at the specified coordinates.
--
Level.getFurnaceSlotCount(x, y, z, slot);
Returns the count of the item at slot in the furnace located at the specified coordinates.
--
Level.getFurnaceSlotData(x, y, z, slot);
Returns the data/damage value of the item at slot in the furnace located at the specified coordinates.
--
Level.getGameMode();
Returns the current game mode. 0=survival, 1=creative.
--
Level.getGrassColor(x, z);
This is actually a part of the base game for it setting biome grass colors as well as the blending of grass blocks between biomes. Returns the grass color at the specified x and z coordinates.
--
Level.getLightningLevel();
Returns the strength the current lightning storm is. 0 means there isn't one going on at that time.
--
Level.getRainLevel();
Returns the strength the current rain is. 0 means there isn't one going on at that time.
--
Level.getSignText(x, y, z, line);
Returns the specified line's text on the sign at the specified coordinates.
--
Level.getSpawnerEntityType(x, y, z);
Returns the EntityType of the mob spawner located at the specified coordinates.
--
Level.getTile(x, y, z);
Returns the ID of the block that is located at the specified coordinates.
--
Level.getTime();
Returns the current ticks in the game. (Does it always count up after the next day? Is this even correct?)
--
Level.getWorldDir();
Returns the path of the currently loaded world's save directory or null (an empty string?) if you are playing multiplayer and you are not the host. This is different from the name that shows up in your world selection screen.
--
Level.getWorldName();
Returns the name of the currently loaded world. This is different from the world's save directory. (Does this do the same if connected to a server or other player's world that you are hosting?)
--
Level.playSound(x, y, z, sound, volume, pitch);
Plays a sound in the world.
--
Level.playSoundEnt(entity, sound, volume, pitch);
Plays a sound attached to an entity.
--
Level.setChestSlot(x, y, z, slot, itemId, itemDamage, itemCount);
Sets a chest slot to a specified item.
--
Level.setChestSlotCustomName(x, y, z, slot, newName);
Sets a custom name to an existing item in a chest.
--
Level.setDifficulty(newDifficulty);
Sets the new difficulty level of the world. 0=peaceful, 1=easy, ...
--
Level.setFurnaceSlot(x, y, z, slot, id, data, count);
Sets a slot in a furnace to a specific item.
--
Level.setGameMode(newGameMode);
Changes the current game mode. 0=survival, 1=creative.
--
Level.setGrassColor(x, z, colorInt);
Sets the grass color at the specified coordinates to the specified color.
--
Level.setLightningLevel(strength);
Sets the new lightning level's strength.
--
Level.setNightMode(setNight);
Sets the current time to night or day.
--
Level.setRainLevel(strength);
Sets the strength of the current rain.
--
Level.setSignText(x, y, z, line, text);
Sets a line of text on the sign at the specified coordinates.
--
Level.setSpawn(x, y, z);
Sets the spawn point.
--
Level.setSpawnerEntityType(x, y, z, entityType);
Sets the mob spawner's entity that spawns at the specified coordinates.
--
Level.setTile(x, y, z, id, data);
Sets a block in the world. Use 0 for id and data to remove without breaking.
--
Level.setTime(ticks);
Sets the world's time in ticks. Note that Pocket Edition has a different amount of ticks representing day and night.
--
Level.spawnChicken(x, y, z, skin);
Spawns a chicken with the specified skin and returns a reference to it.
--
Level.spawnCow(x, y, z, skin);
Spawns a cow with the specified skin and returns a reference to it.
--
Level.spawnMob(x, y, z, entityType, skin);
Spawns a mob with the specified EntityType and skin and returns a reference to it.
Returns the entity's position on the specified axis.
--
Entity.getYaw(entity);
Returns the entity's yaw. (Related to where it is looking.)
--
Entity.isSneaking(entity);
Returns true if the entity is sneaking, false otherwise.
--
Entity.remove(entity);
Removes the entity. WARNING: Do not use on the player as it will cause issues. Test if the entity is Player.getEntity() if using a random entity, especially from Entity.getAll().
--
Entity.removeAllEffects(entity);
Removes all MobEffects from an entity.
--
Entity.removeEffect(entity, effect);
Removes the specified potion effect from an entity.
--
Entity.rideAnimal(rider, mount);
Makes an entity ride another. (Is rider restricted to the player?)
--
Entity.setAnimalAge(entity, age);
Sets an entity's age. Works with entities that have a baby form.
--
Entity.setArmor(entity, slot, id, data);
Sets a piece of armor on an entity.
--
Entity.setArmorCustomName(entity, slot, newName);
Sets a piece of armor's custom name on an entity.
--
Entity.setCape(entity, par2String);
This currently does nothing. It still exists to make sure old scripts don't break.
// can use preventDefault()
function attackHook(attacker, victim)
// can use preventDefault()
function chatHook(str)
// can use preventDefault()
function continueDestroyBlock(x, y, z, side, progress)
// can use preventDefault()
function destroyBlock(x, y, z, side)
function projectileHitEntityHook(projectile, targetEntity)
function eatHook(hearts, saturationRatio)
function entityAddedHook(entity)
// can use preventDefault()
function entityHurtHook(attacker, victim, halfhearts)
function entityRemovedHook(entity)
// can use preventDefault()
function explodeHook(entity, x, y, z, power, onFire)
// can use preventDefault()
function serverMessageReceiveHook(str)
// can use preventDefault()
function deathHook(attacker, victim)
// can use preventDefault()
function playerAddExpHook(player, experienceAdded)
// can use preventDefault()
function playerExpLevelChangeHook(player, levelsAdded)
function redstoneUpdateHook(x, y, z, newCurrent, someBooleanIDontKnow, blockId, blockData)
function newLevel()
// can use preventDefault()
function startDestroyBlock(x, y, z, side)
function projectileHitBlockHook(projectile, blockX, blockY, blockZ, side)
function modTick()
// can use preventDefault()
function useItem(x, y, z, itemid, blockid, side, itemDamage, blockDamage)
Hey! This is not ready yet!
I'll copy my data file into separate posts then slowly add content into it.
Please don't replay until I put a better message in this opening post as I want all the content to be together.
Functions in the Global namespace. (You specify them as-is.)
Obsolete functions. For these you should instead use their correct function elsewhere.
These functions are the only ones you should use without specifying something like Level. at the start.
--
Adds a message to what you see in your chat.
--
Allows certain functions to not do their default action.
--
Shows a short-lived pop-up message on your screen.
--
Spawns a Zombie Pigman at (x, y, z) with skin as their skin, and holding heldItemId.
ModPE methods:
--
I assume this will dump the internal variable table to either a string as-is or to a file specified by the string variable... I haven't needed to use this so I don't know.
--
I assume this returns a string from the data contained in the texture pack... Never tried it, might never use it.
--
Gets the translated name of a variable in the current language?
--
This one is easy. Returns a string representing the current language code in use.
--
Returns the current Minecraft version of the game itself.
--
Set the identifier string option to be the value of string data.
--
Exits the current single player or multiplayer game you are in.
--
I would assume this logs the message to the system log.
--
Returns an InputStream for reading. It uses path for the location.
--
Overrides specified target texture and replaces it with a new one.
--
Used in storing mod data. This will read option and return the result if it exists.
--
Used in storing mod data. This will remove option from the saved information.
--
Resets the FoV. Good idea to use when the level is exited.
--
Resets all textures and images to what they originally were before ModPE ever edited one.
--
Used in storing mod data. This will save data to option. Both must be strings.
--
Selects a level and loads it up. I assume level is the level's directory.
--
(Guessing) Relocates the camera position to entity.
--
Creates a custom food item.
--
Sets the FoV to fovFactor.
--
Changes the game speed to newSpeed.
--
Complex command. Not for those who don't understand much.
--
Creates a custom item. maxStack is optional.
--
Complex command. Not for those who don't understand much.
--
Complex command. Not for those who don't understand much.
--
Enables a bunch of debugging information about the UI to be sent to the logs. It's a lot of information that WILL slow down your game.
--
Shows a short-lived popup message.
--
Saves a screenshot to path.
Level methods. These are related to the world.
--
Adds particleType particles at the specifed location and velocity. (Is the last one the size? It is an integer!)
--
Returns the name of the specified biome by the numeric biomeId.
--
I assume this is similar to the check if a PC-version beacon can produce its beam. "Does this coordinate have access to the sky?"
--
Destroys the block at the specified coordinates. Be careful of using it at the same coordinates for the destroyBlock hook.
--
Creates one or more dropped item at the specified coordinates and range.
--
Causes an explosion at the specified location and radius. onFire specifies if it summons fire blocks (the ones that cling to wood-like objects and burn them).
--
I guess this might be broken as well?
--
Returns the biome ID at the specified x and z coordinates. Biomes typically didn't factor in the Y coordinate yet.
--
Returns the biome name at the specified x and z coordinates.
--
Returns the current brightness at the specified location. Return values should be between 0 and 15 inclusive.
--
Returns the ID of the item in the slot slot in the chest block located at the specified coordinates.
--
Returns the count of the item in the slot slot in the chest block located at the specified coordinates.
--
Returns the customized name of the item in the slot slot in the chest block located at the specified coordinates.
--
Returns the data/damage value of the item in the slot slot in the chest block located at the specified coordinates.
--
Returns the data/damage value of the block at the specified coordinates.
--
Returns the current difficulty as a number. 0=peaceful, 1=easy, ...
--
Returns the ID of the item in the slot slot in the furnace located at the specified coordinates.
--
Returns the count of the item at slot in the furnace located at the specified coordinates.
--
Returns the data/damage value of the item at slot in the furnace located at the specified coordinates.
--
Returns the current game mode. 0=survival, 1=creative.
--
This is actually a part of the base game for it setting biome grass colors as well as the blending of grass blocks between biomes. Returns the grass color at the specified x and z coordinates.
--
Returns the strength the current lightning storm is. 0 means there isn't one going on at that time.
--
Returns the strength the current rain is. 0 means there isn't one going on at that time.
--
Returns the specified line's text on the sign at the specified coordinates.
--
Returns the EntityType of the mob spawner located at the specified coordinates.
--
Returns the ID of the block that is located at the specified coordinates.
--
Returns the current ticks in the game. (Does it always count up after the next day? Is this even correct?)
--
Returns the path of the currently loaded world's save directory or null (an empty string?) if you are playing multiplayer and you are not the host. This is different from the name that shows up in your world selection screen.
--
Returns the name of the currently loaded world. This is different from the world's save directory. (Does this do the same if connected to a server or other player's world that you are hosting?)
--
Plays a sound in the world.
--
Plays a sound attached to an entity.
--
Sets a chest slot to a specified item.
--
Sets a custom name to an existing item in a chest.
--
Sets the new difficulty level of the world. 0=peaceful, 1=easy, ...
--
Sets a slot in a furnace to a specific item.
--
Changes the current game mode. 0=survival, 1=creative.
--
Sets the grass color at the specified coordinates to the specified color.
--
Sets the new lightning level's strength.
--
Sets the current time to night or day.
--
Sets the strength of the current rain.
--
Sets a line of text on the sign at the specified coordinates.
--
Sets the spawn point.
--
Sets the mob spawner's entity that spawns at the specified coordinates.
--
Sets a block in the world. Use 0 for id and data to remove without breaking.
--
Sets the world's time in ticks. Note that Pocket Edition has a different amount of ticks representing day and night.
--
Spawns a chicken with the specified skin and returns a reference to it.
--
Spawns a cow with the specified skin and returns a reference to it.
--
Spawns a mob with the specified EntityType and skin and returns a reference to it.
Player methods. Operates on the player or the player's inventory.
--
Adds the specified amount of experience.
--
Adds an item to the player's current inventory while they are in creative.
--
Adds an item to the player's current inventory while they are in survival.
--
Returns true if the player can fly, false otherwise.
--
Clears the specified slot in the player's current inventory.
--
Enchants the specified item with the specified enchantment. NOTE: Uses no experience levels.
--
Returns the specified armor slot's item ID.
--
Returns the specified armor slot's item data/damage value.
--
Returns the selected hotbar slot's item ID.
--
Returns the selected hotbar slot's item count.
--
Returns the select hotbar slot's item data/damage value.
--
Returns the current dimension ID that the player is in.
--
Returns the enchantments on the item as a list, or null if it failed.
--
Returns the entity of the player. NOTE: This it NOT the same as the EntityType!
--
??? I don't know if this is the same as getHunger or getSaturation.
--
Returns the amount of experience you have. (Does it return the full total or the amount on the current level?)
--
Returns the amount of hunger the player has remaining.
--
Returns the ID of the specified item in the player's inventory.
--
Returns the count of the specified item in the player's inventory.
--
Returns the data/damage value of the specified item in the player's inventory.
--
Returns the custom name of the specified item in the player's inventory.
--
Returns the player's experience level.
--
Returns the specified player's name.
--
Returns the data/damage value of the block that is being pointed at.
--
Returns the ID of the block that is being pointed at.
--
Returns the side of the block that is being pointed at.
--
Returns the X coordinate of the block that is being pointed at.
--
Returns the Y coordinate of the block that is being pointed at.
--
Returns the Z coordinate of the block that is being pointed at.
--
Returns the entity that is being pointed at.
--
I'll have to test these to find out if they are the velocity of the pointed movement or the velocity of what is currently being pointed at.
--
Returns the player's saturation. Higher saturation causes the player not to start losing hunger as soon.
--
Returns the player's score. This is normally seen on the player's death screen.
--
Returns the selected slot on the player's hotbar.
--
Returns the player's X coordinate. Shortcut to Entity.getX(Player.getEntity()).
--
Returns the player's Y coordinate. Shortcut to Entity.getY(Player.getEntity()).
--
Returns the player's Z coordinate. Shortcut to Entity.getZ(Player.getEntity()).
--
Returns true if the player is currently flying, false otherwise.
--
Returns true if the specified entity is a player, false otherwise.
--
Sets the player's armor slot item to the specified item.
--
Set to true to enable the player to fly, false to disable.
--
??? See my comment on Player.getExhaustion
--
Sets the player's experience. (Does this set overall experience or current experience on the player's current level?)
--
Sets if the player is actively flying (true) or not (false).
--
Sets the player's current health in half-hearts.
--
Sets the player's current hunger amount.
--
Sets a slot in the player's inventory to an item.
--
Sets the custom name of an item in the player's inventory.
--
Sets the player's experience level.
--
Sets the player's saturation value.
--
Sets what slot is selected on the player's hotbar.
Entity methods. Relates to all things entity, including mobs, dropped items, arrows, and even players.
--
Adds a MobEffect/font] to an entity. Some people have ambient set to false because there seems to be no visual difference.
--
Returns a list of all entities, including players.
--
Returns the age of the entity. Works with entities that have a baby form.
--
Returns the id of the armor at the slot specified of the entity.
--
Returns the custom name of the armor at the slot specified on the entity.
--
Returns the data/damage value of the armor at the slot specified on the entity.
--
Returns the EntityType of the specified entity.
--
Returns data saved on an entity that was previously saved by Entity.setExtraData.
--
Returns the current heath of the entity.
--
Returns the count of the held item on the entity.
--
Returns the data/damage value of the held item on the entity.
--
Returns the id of the held item on the entity.
--
Returns the maximum health of the entity.
--
Returns the mob's skin. (Is this the path to the file or the raw data itself?)
--
Returns the mob's name as specified by having a name tag item applied to it or Entity.setNameTag.
--
Returns the entity's pitch. (Related to where it is looking. Is this the horizontal or vertical rotation?)
--
Returns the entity's EntityRenderType.
--
Returns the entity which is riding this entity. (Does this return null when it doesn't have one riding?)
--
Returns the entity which this entity is riding on. (Does this return null when this entity isn't riding another?)
--
??? I guess this one gets the mob's target entity or something.
--
Returns this entity's current UUID. May become invalid at any time, especially on opening the world again.
--
Returns the entity's velocity on the specified axis.
--
Returns the entity's position on the specified axis.
--
Returns the entity's yaw. (Related to where it is looking.)
--
Returns true if the entity is sneaking, false otherwise.
--
Removes the entity. WARNING: Do not use on the player as it will cause issues. Test if the entity is Player.getEntity() if using a random entity, especially from Entity.getAll().
--
Removes all MobEffects from an entity.
--
Removes the specified potion effect from an entity.
--
Makes an entity ride another. (Is rider restricted to the player?)
--
Sets an entity's age. Works with entities that have a baby form.
--
Sets a piece of armor on an entity.
--
Sets a piece of armor's custom name on an entity.
--
This currently does nothing. It still exists to make sure old scripts don't break.
--
Sets the item to be held by an entity.
--
last post here will be reserved for the easily-accessible constants