ModPE Framework Wiki - Red-Eagle-Reborn/ModPE-Wiki GitHub Wiki

ModPE FrameWork

What is ModPE Framework ?

  • A Framework to shorten a modpe function

Why Should I Use This ?

  • You can use this or no, but if you want a short function, use this framework

How to use this framework ?

  • Just Copy the Obfuscated Code, look at ModPEObfuscated.js, copy and place it on first line of your mod script.

THE WIKI

R.

setTime

  • R.setTime(time)
  • Use this to set game time

getTime

  • R.getTime()
  • Use this to get game time

getBlock

  • R.getBlock(x,y,z)
  • Get block in specific coordinate, same like Level.getTile(x,y,z);

setGm

  • R.setGm(gamemode)
  • Set the game GameMode, use parameter c/1 for creative, s/0 for survival

getGm

  • R.getGm()
  • Get the game GameMode.

getData

  • R.getData(x,y,z);
  • Same like Level.getData(x,y,z);

worldDir

  • R.worldDir()
  • Get the current player world directory, same like Level.getWorldDir();

worldName

  • R.worldName();
  • Get the current player world name, same like Level.getWorldName();

addItem

  • R.addItem(id,amount,damage/data/meta);
  • Add item to survival inventory.
  • Leave amount to null for amount 1
  • Leave damage / data / meta null for 0 / no have data

creativeItem

  • `R.creativeItem(id,amount,data);
  • Add item to creative inventory.
  • Leave amount to null for amount 1
  • Leave damage / data / meta null for 0 / no have data

setCanFly

  • R.setCanFly(0/1);
  • Set player able to fly
  • 1 or true for can fly, 0 or false for disable flying.

setNameTag

  • R.setNameTag(entity,nameTag);
  • Set name tag for entity

getAge

  • R.getAge(ent)
  • Get animals age

setAge

  • R.setAge(ent,age)
  • Set animals age

setPitch

  • R.setPitch(ent,pitch);
  • Set entity pitch.
  • Leave parameter / argument blank for set player pitch

setYaw

  • R.setYaw(ent,yaw);
  • Set entity yaw
  • Leave parameter / argument blank for set player yaw

getPitch

  • R.getPitch(ent);
  • Get entity pitch.
  • Leave parameter / argument blank for get player pitch

getYaw

  • R.getYaw(ent);
  • Get entity yaw
  • Leave parameter / argument blank for get player yaw

ride

  • R.ride(rider,mount)
  • Set entity or player rider another entity
  • type params / args 0 / null / undefined for set player as rider

newBlock

  • R.newBlock(id,name,texture,materialSourceId,opaque,renderType,color,destroyTime,explotionResistance,LightLevel,LightOpacity)
  • ID = Type the block id, from 0 - 255
  • Name = The block name
  • Texture = the block texture,
  • MaterialSourceID = texture matsrcid
  • opaque = the block opaque null or undefined or 0 it will opaque set to false
  • renderType = the block rendertype, null or undefined or 0 to set the rendertype to normal block (0)
  • color = the block html color, 0/null/undefined to set it normal color ( No Block.setColor function will used )
  • destroyTime = the block destroy time, 0/null/undefined to set it normal destroy time ( no Block.setDestroyTime function will used )
  • explotionResistance = if you set 5, then 5 tnt will destroy it, 0/null/undefined to set it normal resistance ( No Block.setExplotionResistance function will used )
  • LightLevel = block light level, the block brighnesss, 0/null/undefined to set it normal brighness ( No Block.setB righness will used )
  • Lightopacity = the block brighness opacity, 0/null/undefined to set it normal opacity ( no block.setlightopacity will used )

removeEffect

  • R.removeEffect(ent,id);
  • Remove effect in specific mobs
  • leave ent 0/null/undefined to set the entity to player
  • leave id 0/null/undefined to clear all effect.

addEffect

  • R.addEffect(ent,effect,durattion,amplication,ambient,particleAble);
  • Effect can use id or type the effect name example saturation / healtBoost /damageBoost, the effect name are case sensitive you if healthBoost you should type healthBoost not healthboost
  • Leave entity 0/null/undefined to set the entity to player
  • Leave duration 0/null/undefined to set the duration to 1 minutes, the duration are not ticks, its real second, if you type 5, then it will be 5 second, not 1/4 second (Its already calculate by 20 )
  • Leave amplication 0/null/undefined to set it 1, or type the amplication like 8 or 5 etc
  • leave ambient 0/null/undefined to set it false, or type true
  • leave particle 0/null/undefined to set it true, particle will show, if you type false, particle will hide

x y z

  • R.x(); R.y() R.z()
  • get the player x/y/z.
  • same like getPlayerX/Y/Z()

playerEnt()

  • R.playerEnt();
  • get the player ent

mobsX mobsY mobsZ

  • R.mobsX(ent); R.mobsY(ent); R.mobsZ(ent);
  • Get entity specific coordinate

setPost

  • R.setPost(ent,x,y,z);
  • Set some entity coordinate or position, leave entity 0/undefined/null for player ent.

isNull

  • R.isNull(var)
  • Get if the return are 0/undefined/null.

musicPlay

  • `R.musicPlay(musicFolder, musicFile, loop);
  • Don't leave any argument blank, loop are replay, if set true then the song will replay., musicFolder are the music folder, musicFile are the music file name, example R.music("music/","calm_3.mp3",false); this will not replay tge song and will play calm_3.mp3 in music folder.

musicStop

  • R.musicStop()
  • Stop the played music.

chat

  • R.chat(prefix,str);
  • leave prefix 0/undefined/null to set no prefix, prefix are without [], if you type "asd" its will be asd, not [asd]
  • str are the message

spawnMob

  • R.spawnMob(ent,x,y,z,skin)
  • if x,y,z are 0/undefined/null that mean in player coordinate, skin should be use .png "skeleton.png"

newSword

  • R.newSword(id,texture,data/materialsourceid,name,damage,uses/how much time use ( durability);
  • Don't leave any parameter - args blank

mainattackhook

  • mainattackhook(a,v)
  • Don't use R., attackHook are moved to mainattackhook, mainattackhook are work likes attackHook.