Here. I used the function modTick, as this executes something every twentieth of a second (20 times in a second, 100 times in 5 seconds). I have tested this on android, but I'm not sure if this will work on iOS. Here is a simple script i put together:
var countdownMode = 0;
var countdown;
function useItem(x,y,z,itemId,blockId,side) {
if(itemId == 280) {
if(countdownMode == 0) {
countdown = 100;
countdownMode = 1;
clientMessage("Countdown started!")
}
}
}
function modTick() {
if(countdownMode == 1) {
if(countdown != 0) {
countdown--;
} if(countdown == 0) {
clientMessage("It has been 5 seconds!")
countdownMode = 0;
}
}
}
Here. I used the function modTick, as this executes something every twentieth of a second (20 times in a second, 100 times in 5 seconds). I have tested this on android, but I'm not sure if this will work on iOS. Here is a simple script i put together:
var countdownMode = 0;
var countdown;
function useItem(x,y,z,itemId,blockId,side) {
if(itemId == 280) {
if(countdownMode == 0) {
countdown = 100;
countdownMode = 1;
clientMessage("Countdown started!")
}
}
}
function modTick() {
if(countdownMode == 1) {
if(countdown != 0) {
countdown--;
} if(countdown == 0) {
clientMessage("It has been 5 seconds!")
countdownMode = 0;
}
}
}
Many thanks,
Connor4898
Oh cool, but the tick intervals cannot be changed, so not that good, hopefully carter fixes it...At least the repeat ticks method... WHAT AM I EVEN SAYING??? but thx...
Oh cool, but the tick intervals cannot be changed, so not that good, hopefully carter fixes it...At least the repeat ticks method... WHAT AM I EVEN SAYING??? but thx...
Why don't you just do -20 ticks that way it'll subtract a second?
var tickActivate=false;
var activity=false;
var ticks;
var item=//item ID here;
var number=//set time here;
function useItem(x,y,z,itemId,blockId,side){
if(itemId==item&&tickActivate==false){
tickActivate=true;
ticks=number
}
else if(activity==true){
//code here
activity=false
}
}
function modTick(){
if(tickActivity==true){
ticks--
}
else if(ticks<=0){
activity==true
}
}
var tickActivate=false;
var activity=false;
var ticks;
var item=//item ID here;
var number=//set time here;
function useItem(x,y,z,itemId,blockId,side){
if(itemId==item&&tickActivate==false){
tickActivate=true;
ticks=number
}
else if(activity==true){
//code here
activity=false
}
}
function modTick(){
if(tickActivity==true){
ticks--
}
else if(ticks<=0){
activity==true
}
}
Try that.
That's because the editor was not meant for mobile devices.
By the way....
If a tick is 1/20th of a second, then 20 ticks should equal a second.
Simple math.
Most modders should know that
oh cool!! thx! its just that i never used ticks before... only sticked to other functions...
Help my minecraft crashes when I open it what do I do
install ifile from cydia and tap the "go back" arrow on the top left 2 times then go to Library>MobileSubstrate>DynamicLibraries then delete TreeBlHax.dylib and TreeBlHax.plist and u unistalled it sccessfully!!!(if u'r not a noob...) but treebl, add an uninstall function it will be easier...
On a IOS 5 device, is it possible to use this ModPE isntaller?
After deleting all other mods, i have installed ModPE with the installer, sadly it always crash my mcpe after the showing the ModPE image
Apple is not happy to have modded apps on their devices so they "ordered" Mojang to block it off.
Apple is just being rude, repulsive and violent to their users, thats why I m on Android
And if you guys want mods so badly then just downgrade... or... play the game the way it is. This is a lot harder on treebl than on you guys, too. He kinda has to completely recode ModPE... and if Apple keeps being a douche I think he might stop it if Mojang keeps changing the source code.
You need a URL to set the terrain I.e ModPe.setTerrain http://example/downl...terrain.png���� It changes the terrain mid-game and its the same the the setguiBlocks etc, and the resetimages just resets the terrain, GUI etc to its original state.
I made my script and it looks fine, but when I launch PE and type in my script id it says loading and then it says get script again. And in the game the script wont work. I also tried using the example scripts, but those didn't work either. Am I doing something wrong? My script id is kt7ziz.
Also, how do I get this to work on non-jailbroken? Is there a file manager I should use? (i-Funbox can't see the '/' directory)
How To Install ModPE v0.5 Alpha
Step 1:
Add this repo:
http://www.itiaprepo.com/modpe/
Step 2:
Search for ModPE Installer, or just browse the repo you just added, and find ModPE Installer.
Step 3:
Install ModPE Installer
Step 4:
Open ModPE Installer and Click Install
Step 5:
Restart Minecraft PE if it is open!
Done!
ModPE Script v0.5 Alpha Release
Licensed under the Creative Commons Attribution-NoDerivs 3.0 Unported license
Please View the details of the license here: http://creativecommons.org/licenses/by-nd/3.0/legalcode
Made by Carter Feldman
Copyright 2013
Steps:
1.
Install using the instructions above.
2.
Register at
http://betamodpe2.cf.gy/user/register.php
3.
Confirm your email
4.
Login and click on LOAD SCRIPT EDITOR
5.
Under "Create New Script" type in your script name and press "Create New Script"
6.
Wait a few seconds and then click on the "My Scripts" drop down, select your script and press "Load"
7.
Code your script, and when your done, press "Save" in the top left hand corner.
8.
Copy down the Script ID displayed in the top right hand corner (It should say Currently Editing: <your script name> Script ID: <your script id>)
9.
Start Minecraft PE and enter in your id!
----------------------
Built in Function List:
function print(text);
function clientMessage(text);
function setNightMode(isNight);
function getPlayerX();
function getPlayerY();
function getPlayerZ();
function getPlayerEnt();
function getLevel();
function getMCPE();
function getYaw();
function getPitch();
function setPosition(ent,x,y,z);
function setPositionRelative(ent,x,y,z);
function setRot(ent,x,y);
function getTile(x,y,z);
function setVelX(ent, amount);
function setVelY(ent, amount);
function setVelZ(ent, amount);
function explode(x, y, z, radius);
function addItemInventory(id, amount);
function rideAnimal(player, target);
function getCarriedItem();
function preventDefault();
function setTile(x,y,z,type);
function spawnChicken(x,y,z,image);
function spawnCow(x,y,z,image);
function spawnPigZombie(x,y,z,item,image);
//New OOP funcs below
function ModPE.setTerrain(url);
function ModPE.setItems(url);
function ModPE.setGuiBlocks(url);
function ModPE.resetImages();
function Level.setNightMode(isNight);
function Level.getTile(x,y,z);
function Level.explode(x, y, z, radius);
function Level.setTile(x,y,z,type);
function Level.getAddress();
function Level.spawnChicken(x,y,z,image);
function Level.spawnCow(x,y,z,image);
function Player.getX();
function Player.getY();
function Player.getZ();
function Player.getEntity();
function Player.getCarriedItem();
function Player.addItemInventory(id, amount);
function Entity.setVelX(ent, amount);
function Entity.setVelY(ent, amount);
function Entity.setVelZ(ent, amount);
function Entity.setRot(ent,x,y);
function Entity.rideAnimal(player, target);
function Entity.setPosition(ent,x,y,z);
function Entity.setPositionRelative(ent,x,y,z);
function Entity.getYaw(ent);
function Entity.getPitch(ent);
Example Scripts:
---------------------------------------------------
Example 1:
function useItem(x,y,z,itemId,blockId,side)
{
if(itemId==280)//If your item is a stick
{
addItemInventory(3,5);//Add 5 Dirt blocks to your inventory.
print("Hello World");
}
}
function attackHook(attacker, victim)
{
if(getCarriedItem()==280)//If your item is a stick
{
preventDefault();//Don't call the real attack function after
setVelY(victim,1.5);//Make them fly vertically =)
}
}
function modTick()
{
}
---------------------------------------------------
---------------------------------------------------
Example 2:
function useItem(x,y,z,itemId,blockId,side)
{
if(itemId==291&&blockId==4)//If your item is a stone hoe, and the block your using it on is stone
{
explode(x,y,z,3.1);//Blow it up!
}
else if(blockId==5)//If the block we are using is a wooden plank
{
setTile(x,y,z,11);//Turn it into lava!!
}
else if(itemId==287)//If our item is string
{
ImAHelperFunction(x,y,z);//make a gold tower!
}
}
function ImAHelperFunction(x,y,z)
{
for(var i=0;i<5;i++)
{
setTile(x,y+i,z,14);
}
}
function attackHook(attacker, victim)
{
var ourItem = getCarriedItem();//The id of the item we are wielding
if(ourItem==288)//If the item is a feather
{
preventDefault();//Don't call the real attack function after
rideAnimal(attacker,victim);//ride the animal
}
else if(ourItem==262)//If the item is an arrow
{
spawnChicken(getPlayerX(),getPlayerY()+4,getPlayerZ(),"mob/chicken.png");//spawn a chicken above our head (you can change it to your own picture if you like)
}
}
function modTick()
{
}
------------------------------------------------------
More Examples Coming Soon!
---------------------------------------------------
New Hook CMD!
function procCmd(cmd)
{
}
Hey treebl can u make it so that when u are writing ids of blocks u can also write damage.
But mojang should share with Code or the others about this it would help a lot also if anyone knows what's 10 eruos lol not sure if that's cents or not
too bad, it doesnt exist...(at least so far...) but great idea HOPEFULLY treebl sees this page again...
ok im a noob at symbols but thx
Very helpful!
Mind if I use this in my video tutorials?
Oh cool, but the tick intervals cannot be changed, so not that good, hopefully carter fixes it...At least the repeat ticks method... WHAT AM I EVEN SAYING??? but thx...
Why don't you just do -20 ticks that way it'll subtract a second?
What???
var tickActivate=false; var activity=false; var ticks; var item=//item ID here; var number=//set time here; function useItem(x,y,z,itemId,blockId,side){ if(itemId==item&&tickActivate==false){ tickActivate=true; ticks=number } else if(activity==true){ //code here activity=false } } function modTick(){ if(tickActivity==true){ ticks-- } else if(ticks<=0){ activity==true } }Try that.
That's because the editor was not meant for mobile devices.By the way....
If a tick is 1/20th of a second, then 20 ticks should equal a second.
Simple math.
Most modders should know that
oh cool!! thx! its just that i never used ticks before... only sticked to other functions...
install ifile from cydia and tap the "go back" arrow on the top left 2 times then go to Library>MobileSubstrate>DynamicLibraries then delete TreeBlHax.dylib and TreeBlHax.plist and u unistalled it sccessfully!!!(if u'r not a noob...) but treebl, add an uninstall function it will be easier...
After deleting all other mods, i have installed ModPE with the installer, sadly it always crash my mcpe after the showing the ModPE image
Apple is a douche.
iOS is a douche.
can you give an example of code ?
*NEW* Repo:
http://www.itiaprepo.com/modpe/
How to install
Text Tutorial:
Readme:
New Hook CMD!
function procCmd(cmd) { }Hey treebl can u make it so that when u are writing ids of blocks u can also write damage.
When will it be capable with 0.7.3 ? And also do you need a decrypted version of the game?