IIm Not In GUI But Ill Send That PC GUI Pic, I Have No Idea How To Remake It To PE Or To Make GUI Block, Its Really Hard For Me, Im Makeing Armor Define And That Kinda Stuff
Here is a template for a button with image:
//template for a button with image
var path=android.os.Environment.getExternalStorageDirectory().getAbsolutePath()+"/games/com.mojang/ModScript/"; //path of the image
var img = new android.graphics.BitmapFactory.decodeFile(path + "ModPE.png"); //ModPE.png is the name of the image and the image has to be in the path defined in path
var image = new android.graphics.drawable.BitmapDrawable(img);
var GUI;
createGUI(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
try{
GUI=new android.widget.PopupWindow(ctx);
var layout = new android.widget.LinearLayout(ctx);
var button1 = new android.widget.Button(ctx);
button1.setBackgroundDrawable(image); //give the button the image as background
button1.setWidth(120);
button1.setHeight(120); //set width and height of the button to the width and height of the image
button1.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(viewarg){
//Your Code here
}
}));
button1.setOnLongClickListener(new android.view.View.OnLongClickListener({
onLongClick: function(viewarg){
try{
//Your Code for the OnLongClickListener here
}catch(err){
print("An error occured: " + err);
}
return true;
}
}));
layout.addView(button1);
GUI = new android.widget.PopupWindow(layout, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT);
GUI.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.TRANSPARENT));
GUI.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.LEFT | android.view.Gravity.BOTTOM, 0, 0);
}catch(err){
print("An error occured while trying to show GUI: " + err);
}
}}));
}
function dismissGUI(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
if(GUI!=null){
GUI.dismiss();
GUI=null;
}
}}));
}
And this function returns the Slot with the Item with the Id. It returns -1 if the Player has not the item in the inventory. I thought this function could be useful for a custom furnace.
function getSlotOfItem(theId){
var slotNumber=-1;
for(var i=9; i<45; i++){
if(Player.getInventorySlot(i)==theId){
slotNumber=i;
}
}
return slotNumber;
}
I can try to help you, but I can't make everything for you.
Or if you just want when a button is simply clicked:
function useItem(x, y, z, itemID, blockID) {
if(blockID == 77) { //stone button
clientMessage('clicked button');
}
}
Does Anyone Know How To Create Custom Crop And Growing Time, Like Wheat ? AND To Get Seeds Like Wheat And Breaking Grass, If You Guys Know 5That Help Me, I Need To Make One Funny Mod, Its Funny
To create a custom crop, you must load and save an array with the "crops" coordinates.
If you look here I have custom functions called ModPE.saveWorldFile(); and ModPE.loadWorldFile();
if you copy these two functions, then you can use them. the parameters should be self explanatory. In this respiratory you can see other various ways I do things in ModPE.
I really suggest you learn JavaScript thoroughly before starting ModPE. I also suggest you learn what each hook and method does. This stuff is simple if you learn the stuff.
This is a brilliant wip documentation page. http://sliceofcode.github.io/zxc/
Is it possible to make a house waithout setTile in mod?
And how to use material design in my app?
And is it possible to make a 64*64 texture pack and put it in block launcher waithout crashing?
Yes, yes, and yes.
1. Do as many setTile as you want. But watch out for lag.
2. Unless your phone has material UI by default, you will have to use custom images and styling to get it.
3. If a texture pack crashes on load, it probably isn't updated to the latest version of Minecraft PE.
Or there is something wrong with the metas or other data-based file.
Yes, yes, and yes.
1. Do as many setTile as you want. But watch out for lag.
2. Unless your phone has material UI by default, you will have to use custom images and styling to get it.
3. If a texture pack crashes on load, it probably isn't updated to the latest version of Minecraft PE.
Or there is something wrong with the metas or other data-based file.
i thought it was on phone system like if its 5.0 lollipop it will be easy to get rid of lags, well i have 4.2.2 so im lagged --_--
Rollback Post to RevisionRollBack
Hey, There
Check Out My YT Channel And Dont Forget To Subscribe
http://bit.ly/1oDas1b
Also I Have A Website, There Are Lots Of Things There
I want to use an item to spawn a structure. I would like to use the dye though. Unsure how to get the 3512 Though. Let's say I wanted to use a Dye item. Let's say the lime dye. Would it be if itemId == 351:10? Or if itemId == 35110. Please let me know, Thank You.
Rollback Post to RevisionRollBack
iOS 9.2.1 Kernel dump exploit success. nvRAM is an issue as overriding it is a big dilemma to many iOS jailbreak developers; Taig is having problems with the Crypto and Apple's signature of all things. I've been working on overriding Apple's signature for the past month with no luck. But, did bypass the Crypto. The kernel is now vulnerable to start exploiting.
so in damage u use it like this damage is the key lolol you need id of course to spawn but i can make you texture pack if u want , that would be easy, to make item textures and then use that items to spawn random buildings hows that???
Rollback Post to RevisionRollBack
Hey, There
Check Out My YT Channel And Dont Forget To Subscribe
http://bit.ly/1oDas1b
Also I Have A Website, There Are Lots Of Things There
But when i import the mod and go in game and tap the "menu" button my material design is not showed
My mod code:
var GUI;
var menu;
var exitUI;
function dip2px(dips){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
return Math.ceil(dips * ctx.getResources().getDisplayMetrics().density);
}
function newLevel(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
try{
var layout = new android.widget.LinearLayout(ctx);
layout.setOrientation(1);
var menuBtn = new android.widget.Button(ctx);
menuBtn.setText('Menu');
menuBtn.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(viewarg){
mainMenu();
exit();
}
}));
layout.addView(menuBtn);
GUI = new android.widget.PopupWindow(layout, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT);
GUI.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.TRANSPARENT));
GUI.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.RIGHT | android.view.Gravity.BOTTOM, 10, 20);
}catch(err){
print('An error occured: ' + err);
}
}}));
}
function mainMenu(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
try{
var menuLayout = new android.widget.LinearLayout(ctx);
var menuScroll = new android.widget.ScrollView(ctx);
var menuLayout1 = new android.widget.LinearLayout(ctx);
menuLayout.setOrientation(1);
menuLayout1.setOrientation(1);
menuScroll.addView(menuLayout);
menuLayout1.addView(menuScroll);
var button = new android.widget.Button(ctx);
button.setText('Button');
button.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(viewarg){
//Your Code Here...
}
}));
menuLayout.addView(button);
var b = new $Button();
b.setText("test");
b.setColor(android.graphics.Color.parseColor('#4fc3f7'));
b.show();
//More buttons...
menu = new android.widget.PopupWindow(menuLayout1, ctx.getWindowManager().getDefaultDisplay().getWidth()/2, ctx.getWindowManager().getDefaultDisplay().getHeight()/2);
menu.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.BLACK));
menu.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.CENTER,0, 0);
}catch(error){
print('An error occured: ' + error);
}
}}));
}
function exit(){
var ctxe = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctxe.runOnUiThread(new java.lang.Runnable({ run: function(){
try{
var xLayout = new android.widget.LinearLayout(ctxe);
var xButton = new android.widget.Button(ctxe);
xButton.setText('X');
xButton.setTextColor(android.graphics.Color.WHITE);
xButton.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(viewarg){
exitUI.dismiss();
menu.dismiss();
}
}));
xLayout.addView(xButton);
exitUI = new android.widget.PopupWindow(xLayout, dip2px(40), dip2px(40));
exitUI.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.TRANSPARENT));
exitUI.showAtLocation(ctxe.getWindow().getDecorView(), android.view.Gravity.RIGHT | android.view.Gravity.TOP, 0, 0);
}catch(exception){
print(exception);
}
}}));
}
function leaveGame(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
if(GUI != null){
GUI.dismiss();
GUI = null;
}
if(menu != null){
menu.dismiss();
menu = null;
}
if(exitUI != null){
exitUI.dismiss();
exitUI = null;
}
}}));
}
U can use GUI Mod Maker Its Simple, Just It Has Exmpls And Stuff, I Recomend U Use That App, Its From Elvin Developments Or Something... Its Lot EasyTat Way, And Cool Too, Just Try It Out
Rollback Post to RevisionRollBack
Hey, There
Check Out My YT Channel And Dont Forget To Subscribe
http://bit.ly/1oDas1b
Also I Have A Website, There Are Lots Of Things There
Now, let's say I wanted to spawn a structure using a different type of dye, such as the red dye, what would I have to do to make that happen. Also, I tried if(itemId == 351:1) and it gives me an error. So obviously, that wouldn't work.
Rollback Post to RevisionRollBack
iOS 9.2.1 Kernel dump exploit success. nvRAM is an issue as overriding it is a big dilemma to many iOS jailbreak developers; Taig is having problems with the Crypto and Apple's signature of all things. I've been working on overriding Apple's signature for the past month with no luck. But, did bypass the Crypto. The kernel is now vulnerable to start exploiting.
Now, let's say I wanted to spawn a structure using a different type of dye, such as the red dye, what would I have to do to make that happen. Also, I tried if(itemId == 351:1) and it gives me an error. So obviously, that wouldn't work.
Here is a template for a button with image:
//template for a button with image
var path=android.os.Environment.getExternalStorageDirectory().getAbsolutePath()+"/games/com.mojang/ModScript/"; //path of the image
var img = new android.graphics.BitmapFactory.decodeFile(path + "ModPE.png"); //ModPE.png is the name of the image and the image has to be in the path defined in path
var image = new android.graphics.drawable.BitmapDrawable(img);
var GUI;
createGUI(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
try{
GUI=new android.widget.PopupWindow(ctx);
var layout = new android.widget.LinearLayout(ctx);
var button1 = new android.widget.Button(ctx);
button1.setBackgroundDrawable(image); //give the button the image as background
button1.setWidth(120);
button1.setHeight(120); //set width and height of the button to the width and height of the image
button1.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(viewarg){
//Your Code here
}
}));
button1.setOnLongClickListener(new android.view.View.OnLongClickListener({
onLongClick: function(viewarg){
try{
//Your Code for the OnLongClickListener here
}catch(err){
print("An error occured: " + err);
}
return true;
}
}));
layout.addView(button1);
GUI = new android.widget.PopupWindow(layout, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT);
GUI.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.TRANSPARENT));
GUI.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.LEFT | android.view.Gravity.BOTTOM, 0, 0);
}catch(err){
print("An error occured while trying to show GUI: " + err);
}
}}));
}
function dismissGUI(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
if(GUI!=null){
GUI.dismiss();
GUI=null;
}
}}));
}
And this function returns the Slot with the Item with the Id. It returns -1 if the Player has not the item in the inventory. I thought this function could be useful for a custom furnace.
function getSlotOfItem(theId){
var slotNumber=-1;
for(var i=9; i<45; i++){
if(Player.getInventorySlot(i)==theId){
slotNumber=i;
}
}
return slotNumber;
}
I can try to help you, but I can't make everything for you.
Yes, if you are looking to activate a redstone event in ModPE use redstoneUpdateHook, an example here: https://github.com/zhuowei/ModPEScripts/blob/master/piston.js
Or if you just want when a button is simply clicked:
function useItem(x, y, z, itemID, blockID) {
if(blockID == 77) { //stone button
clientMessage('clicked button');
}
}
To create a custom crop, you must load and save an array with the "crops" coordinates.
If you look here I have custom functions called ModPE.saveWorldFile(); and ModPE.loadWorldFile();
if you copy these two functions, then you can use them. the parameters should be self explanatory. In this respiratory you can see other various ways I do things in ModPE.
https://github.com/ManassehPierce/ExNihilo-PE/blob/master/Custom.js
I really suggest you learn JavaScript thoroughly before starting ModPE. I also suggest you learn what each hook and method does. This stuff is simple if you learn the stuff.
This is a brilliant wip documentation page. http://sliceofcode.github.io/zxc/
Also, this may be useful. I tried to make an API for this, but I never revisited it.
https://www.dropbox.com/s/2m51606l1f9bhk6/ModPE - Crops.js?dl=0
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
Hey guys im back with questions
Is it possible to make a house waithout setTile in mod?
And how to use material design in my app?
And is it possible to make a 64*64 texture pack and put it in block launcher waithout crashing?
Yes, yes, and yes.
1. Do as many setTile as you want. But watch out for lag.
2. Unless your phone has material UI by default, you will have to use custom images and styling to get it.
3. If a texture pack crashes on load, it probably isn't updated to the latest version of Minecraft PE.
Or there is something wrong with the metas or other data-based file.
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
i thought it was on phone system like if its 5.0 lollipop it will be easy to get rid of lags, well i have 4.2.2 so im lagged --_--
I want to use an item to spawn a structure. I would like to use the dye though. Unsure how to get the 3512 Though. Let's say I wanted to use a Dye item. Let's say the lime dye. Would it be if itemId == 351:10? Or if itemId == 35110. Please let me know, Thank You.
iOS 9.2.1 Kernel dump exploit success. nvRAM is an issue as overriding it is a big dilemma to many iOS jailbreak developers; Taig is having problems with the Crypto and Apple's signature of all things. I've been working on overriding Apple's signature for the past month with no luck. But, did bypass the Crypto. The kernel is now vulnerable to start exploiting.
look if you creating like exmpl custom item dye would be like this Lapis is called dye_powder like all dyes and its id is 351:4 so we use it like this
ModPE.setItem(2000, "dye_powder", 4, "Blue Poop", 64);
so in damage u use it like this damage is the key lolol you need id of course to spawn but i can make you texture pack if u want , that would be easy, to make item textures and then use that items to spawn random buildings hows that???
Me again :-)
Im find material design library for mcpe mods
in this blog
m.blog.naver.com/astr36
But i don't know how to use this library
Plz help me
go in this site all materials are here http://astr36.dothome.co.kr/library/material/index.html Thats all
I write code to create a material button
But when i import the mod and go in game and tap the "menu" button my material design is not showed
My mod code:
var GUI;
var menu;
var exitUI;
function dip2px(dips){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
return Math.ceil(dips * ctx.getResources().getDisplayMetrics().density);
}
function newLevel(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
try{
var layout = new android.widget.LinearLayout(ctx);
layout.setOrientation(1);
var menuBtn = new android.widget.Button(ctx);
menuBtn.setText('Menu');
menuBtn.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(viewarg){
mainMenu();
exit();
}
}));
layout.addView(menuBtn);
GUI = new android.widget.PopupWindow(layout, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT);
GUI.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.TRANSPARENT));
GUI.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.RIGHT | android.view.Gravity.BOTTOM, 10, 20);
}catch(err){
print('An error occured: ' + err);
}
}}));
}
function mainMenu(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
try{
var menuLayout = new android.widget.LinearLayout(ctx);
var menuScroll = new android.widget.ScrollView(ctx);
var menuLayout1 = new android.widget.LinearLayout(ctx);
menuLayout.setOrientation(1);
menuLayout1.setOrientation(1);
menuScroll.addView(menuLayout);
menuLayout1.addView(menuScroll);
var button = new android.widget.Button(ctx);
button.setText('Button');
button.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(viewarg){
//Your Code Here...
}
}));
menuLayout.addView(button);
var b = new $Button();
b.setText("test");
b.setColor(android.graphics.Color.parseColor('#4fc3f7'));
b.show();
//More buttons...
menu = new android.widget.PopupWindow(menuLayout1, ctx.getWindowManager().getDefaultDisplay().getWidth()/2, ctx.getWindowManager().getDefaultDisplay().getHeight()/2);
menu.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.BLACK));
menu.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.CENTER,0, 0);
}catch(error){
print('An error occured: ' + error);
}
}}));
}
function exit(){
var ctxe = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctxe.runOnUiThread(new java.lang.Runnable({ run: function(){
try{
var xLayout = new android.widget.LinearLayout(ctxe);
var xButton = new android.widget.Button(ctxe);
xButton.setText('X');
xButton.setTextColor(android.graphics.Color.WHITE);
xButton.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(viewarg){
exitUI.dismiss();
menu.dismiss();
}
}));
xLayout.addView(xButton);
exitUI = new android.widget.PopupWindow(xLayout, dip2px(40), dip2px(40));
exitUI.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.TRANSPARENT));
exitUI.showAtLocation(ctxe.getWindow().getDecorView(), android.view.Gravity.RIGHT | android.view.Gravity.TOP, 0, 0);
}catch(exception){
print(exception);
}
}}));
}
function leaveGame(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
if(GUI != null){
GUI.dismiss();
GUI = null;
}
if(menu != null){
menu.dismiss();
menu = null;
}
if(exitUI != null){
exitUI.dismiss();
exitUI = null;
}
}}));
}
Me again :-) :-)
I want to download the super tp mod from here to look that and get help for astro material design :
http://cafe.naver.com/teamio/80
But download link need sign up and i can't sign up
Plz someone download this mod and upload for me
U can use GUI Mod Maker Its Simple, Just It Has Exmpls And Stuff, I Recomend U Use That App, Its From Elvin Developments Or Something... Its Lot EasyTat Way, And Cool Too, Just Try It Out
I registered No English Just Japanese
Plz download the mod from link
And upload again in mediafire and put the link here for me
Plzzzzz
I don't think you understand what I mean. I don't mean using a custom made item.
Ok, so let's say I wanted to spawn a Block or Structure with an Item such as Ink Sack. It would be this code:
Now, let's say I wanted to spawn a structure using a different type of dye, such as the red dye, what would I have to do to make that happen. Also, I tried if(itemId == 351:1) and it gives me an error. So obviously, that wouldn't work.
iOS 9.2.1 Kernel dump exploit success. nvRAM is an issue as overriding it is a big dilemma to many iOS jailbreak developers; Taig is having problems with the Crypto and Apple's signature of all things. I've been working on overriding Apple's signature for the past month with no luck. But, did bypass the Crypto. The kernel is now vulnerable to start exploiting.
function useItem(x, y, z, itemId, blockId, side, itemData, blockData) {
if(itemId == 351 && itemData == 1){
//do stuff
}
}
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
Me again :-) :-) :-) :-)
Is it possible to create custom signs in modpe like road sign or home sign?
If you using google chrome to see web page you can translate it with google translate
Plz download the mod and upload for me
Do You Guys Know How To Make Custom Effects When Wearing Full Set Of Armor, And Like Wearing A Boits And It Gives U Speed 2 How To Do That PLS
Use get.ArmorSlot to check if the player is wearing the armor if so then you can add the effect
function modTick(){
if(Player.getArmorSlot(3)==*id for boots*){
*add the effects you want here*
}
}
--------------------------------
I also have a question. Is there an easy way to know if the player is x number of blocks away of a particular block?
like if I want to know the player is less than 10 blocks away (in any direction) from a furnace.