ive downloaded forge now trying to download mods..i download the mod and put it in the mod folder but then when I open minecraft and click mods no files are there
The Meaning of Life, the Universe, and Everything.
Join Date:
5/16/2015
Posts:
45
Location:
Mexico
Member Details
I have a variable, let's call it X, and an item that changes that variable in game, but when the player leaves the world, X changes back to its original value. Is there a way to keep that variable changed until the player uses the item again?
I have a variable, let's call it X, and an item that changes that variable in game, but when the player leaves the world, X changes back to its original value. Is there a way to keep that variable changed until the player uses the item again?
Using the java bridge to save the varible as a txt file in a specific directory, or you can use ModPE.saveData(); and ModPE.readData(); to save/liad the variable - only issue with the latter is that its not permanent. If you reload the script then it resets itself.
Using the java bridge to save the varible as a txt file in a specific directory, or you can use ModPE.saveData(); and ModPE.readData(); to save/liad the variable - only issue with the latter is that its not permanent. If you reload the script then it resets itself.
Alright, I have tried multiple ways, but setting slowness to mobs doesn't work for me. You see I dont want the mob to be able to move/look around. but This wont work. please any tips?
Yeah, I thought of doing this, the only issue I had was saving the coords. Everytime I use the java bridge to export txt files, and read them again, intergers become strings. so a var a = 0; would become var a = "0"; I know thus is caused by reading using StringBuilder. I want to be able to write numbers like x:0,y:0,z:0; and split the "," and ";" - but if I do that it becomes a string like I said.
Yeah, I thought of doing this, the only issue I had was saving the coords. Everytime I use the java bridge to export txt files, and read them again, intergers become strings. so a var a = 0; would become var a = "0"; I know thus is caused by reading using StringBuilder. I want to be able to write numbers like x:0,y:0,z:0; and split the "," and ";" - but if I do that it becomes a string like I said.
I am trying to make a mod and I am making custom weapon. I have most of it done and I need a few more things. The main thing I need is the code for making my item --with the id of 5000-- have durability and a visible durability bar. If anyone knows how to do this can you type up the code for it.
I am trying to make a mod and I am making custom weapon. I have most of it done and I need a few more things. The main thing I need is the code for making my item --with the id of 5000-- have durability and a visible durability bar. If anyone knows how to do this can you type up the code for it.
I'm so frustrated.
Try my Custom Tool Mod Template
var ITEM = [ITEM_ID, MAX_STACK, MAX_DURABILITY, TEXTURE, TEXTURE_DATA, NAME];
var RECIPE = ["AAA", "BBB", "CCC"];
var RECIPE_DESC = ["A", ID_A, DATA_A, "B", ID_B, DATA_B, etc....];
The Functions... Don't edit nless you know what you're doing
I am trying to make a mod and I am making custom weapon. I have most of it done and I need a few more things. The main thing I need is the code for making my item --with the id of 5000-- have durability and a visible durability bar. If anyone knows how to do this can you type up the code for it.
I'm so frustrated.
Ids are only possible until 4095...
If you want durability you can use Item Damage:
Whenevery it should become damage reomve the item out of the Players inventory and add it again but with one more item-damage. (If it has a special amount of damage don´t add it again to the inventory and use Level.playSound(Player.getX(), Player.getY(), Player.getZ(), "random.break", 1.0, 25.0); to make the breaking item sound.) But you will not see a durability bar.
The Meaning of Life, the Universe, and Everything.
Location:
Auckland
Join Date:
9/20/2014
Posts:
126
Minecraft:
softmage114486
Xbox:
softmage114486
Member Details
I think there is a hook for when doors and chests are opened but im not sure how to use it, i think it is more for like, the opening door version of useItem(), what you could do is make like 8 alternitive doors (or how ever many different states there are) using define block but i think thats getting way too complicated
ive downloaded forge now trying to download mods..i download the mod and put it in the mod folder but then when I open minecraft and click mods no files are there
For some reason this doesn't work...
var blockId
function modTick() {
blockId = Level.getTile(Player.getZ(), Player.getY()-1, getPlayerZ());
if(blockId == 3){
Entity.addEffect(getPlayerEnt(), MobEffect.waterBreathing, 180*20, 1, false, true)
}
}
It's supposed to give you water breathing when the player is standing on top of a dirt block; but it does nothing.
PLEASE HELP!!!
You forgot a ; after defining blockId and you have twice Player.getZ() but no Player.getX().
Oh, that's embarrassing... I'll see if that's the problem. Thanks
Happens everybody
Ty. Tested it and it works good now gonna continue developing it if I have time..
I have a variable, let's call it X, and an item that changes that variable in game, but when the player leaves the world, X changes back to its original value. Is there a way to keep that variable changed until the player uses the item again?
Using the java bridge to save the varible as a txt file in a specific directory, or you can use ModPE.saveData(); and ModPE.readData(); to save/liad the variable - only issue with the latter is that its not permanent. If you reload the script then it resets itself.
-Edit- This link may be of some help: http://www.minecraftforum.net/forums/minecraft-pocket-edition/mcpe-mods-tools/mcpe-mod-tool-help-requests/2325998-saving-a-txt-at-a-modpe-script-javascript-on
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
Thanks. Trying this right now!
Alright, I have tried multiple ways, but setting slowness to mobs doesn't work for me. You see I dont want the mob to be able to move/look around. but This wont work. please any tips?
var pa = Level.spawnMob(x+0.5, y+1, z+0.5, 10);
Entity.setCollisionSize(pa,1,1);
Entity.addEffect(pa,MobEffect.movementSlowdown,9999*20,127,false,true);
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
I'm not sure, maybe is something with BlockLauncher but slowness and speed potion effects only work with creepers, skeletons and zombie pigmen.
Found out all Potion effects are broken on mobs, but I had a creative idea. Thanks anyways!
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
Maybe you can do something like this?
Yeah, I thought of doing this, the only issue I had was saving the coords. Everytime I use the java bridge to export txt files, and read them again, intergers become strings. so a var a = 0; would become var a = "0"; I know thus is caused by reading using StringBuilder. I want to be able to write numbers like x:0,y:0,z:0; and split the "," and ";" - but if I do that it becomes a string like I said.
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
Just use parseInt(String)
---
I use a custom parseInt:
function parseInt2(theInput){
if(theInput=="0")
return 0;
else
return parseInt(theInput);
}
I am trying to make a mod and I am making custom weapon. I have most of it done and I need a few more things. The main thing I need is the code for making my item --with the id of 5000-- have durability and a visible durability bar. If anyone knows how to do this can you type up the code for it.
I'm so frustrated.
Try my Custom Tool Mod Template
The Functions... Don't edit nless you know what you're doing
Ids are only possible until 4095...
If you want durability you can use Item Damage:
Whenevery it should become damage reomve the item out of the Players inventory and add it again but with one more item-damage. (If it has a special amount of damage don´t add it again to the inventory and use Level.playSound(Player.getX(), Player.getY(), Player.getZ(), "random.break", 1.0, 25.0); to make the breaking item sound.) But you will not see a durability bar.
sorry I meant for my id to be 500
I think there is a hook for when doors and chests are opened but im not sure how to use it, i think it is more for like, the opening door version of useItem(), what you could do is make like 8 alternitive doors (or how ever many different states there are) using define block but i think thats getting way too complicated
that was for crazycard btw