ok guys i need a teacher for modscripting ivealready tooken advice from some people like noahz he said to go to codeacademy and i did but you might say im dum but it helpedbut mos things it thought me i dont see how it can work inminecraft but ill try to use them if you want to apply to be my teacher put your email,or skype,or kik ill messege you when im on so youcan tell me stuff of mod scripting like youll tell me here try to make it so that when you hit a mob itll fly into the air and then illask for hep if i need any helpand ill messge you the complete product btw my new email is [email protected]
ok so read the comments darkdiamond miner ima ask and put up scripts tell me if theyll work
function useItem(x, y, z, itemId, blockId, side){
}
useItem is a hook that is used if you want a certain event happen when you tap a block or use a item.
function attackHook(attacker, victim){
}
AttackHook is a hook that is used if you want a certain event to happen when you hit a mob.
function modTick(){
}
ModTick is a hook that is used if you want a certain event to happen using ticks.
Examples:
function useItem(x, y, z, itemId, blockId, side){
if(itemId == 280){ //if item is a stick
addItemInventory(264, 64); // add 64 diamonds!
}
}
Example 2:
function attackHook(attacker, victim){
if(getCarriedItem() == 280){ //if item is a stick
setVelY(victim, 10); //Make them fly vertically
}
}
Example 3:
var tick = 20;
function modTick(){
tick--; //Countdown
if(tick == 0){ //If countdown finishes
setVelY(victim, 4); //Make the player fly vertically
}
}
Complicated example:
function useItem(x, y, z, itemId, blockId, side){
var x = x;
var y = y;
var z = z;
towerOfGold();
}
function towerOfGold(){
for(var i = 0; i < 255; i++){
setTile(x, y+i, z, 41);
}
}
Make sure you follow me on twitter! @DarkDiaMiner IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
thx i know about attack hook and modtick but you showed me how to fix my error i always got thnx so much if i need more help can i ask you and how do i ask you
ok so know i know how to make it so that whe i hit a mob with a certain item a certain something will happen can i make it so i have to hit a specific mob
like
function attackHook(attacker, victim){
if(getCarriedItem() == 57){//if item is diamond block
//then can i add this
if(victim() == zombiePigman){
console.log("Began trade")
so i was hoping that that would make it so when i hit a zombie pigman with a diamond block it wil say Began trade
ok so know i know how to make it so that whe i hit a mob with a certain item a certain something will happen can i make it so i have to hit a specific mob
like
function attackHook(attacker, victim){
if(getCarriedItem() == 57){//if item is diamond block
//then can i add this
if(victim() == zombiePigman){
console.log("Began trade")
so i was hoping that that would make it so when i hit a zombie pigman with a diamond block it wil say Began trade
Try this:
function attackHook(attacker, victim){
if(getCarriedItem() == 280){ //Try to change this to something else. Block don't work. Like a stick or something
if(Entity.getEntityTypeId() == 36){ //Id of Zombie Pigman is 36. To define a mob use Entity.getEntityTypeId()
clientMessage("Trade has started");
}
}
}
Rollback Post to RevisionRollBack
Make sure you follow me on twitter! @DarkDiaMiner IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
function attackHook(attacker, victim){
if(getCarriedItem() == 280){ //Try to change this to something else. Block don't work. Like a stick or something
if(Entity.getEntityTypeId() == 36){ //Id of Zombie Pigman is 36. To define a mob use Entity.getEntityTypeId()
clientMessage("Trade has started");
}
}
}
More information ModTick:
modTick runs the code (inside the hook) every 1/4th of a second (Im pretty sure.)
Another (Slightly more advanced) hook is the deathHook:
var mob = null; //new global variable called mob
function deathHook(murderer, victim) //new hook and the parameters
{
if(victim==mob) //if statement, if the victim (that dies), is a mob
{
clientMessage("A Mob Has Died."); //client message
}
}
So when a mob dies, it will send a client message.
Sorry if the example(for DeathHook) has any errors but you should get the idea, im writing it at school.
More information ModTick:
modTick runs the code (inside the hook) every 1/4th of a second (Im pretty sure.)
Another (Slightly more advanced) hook is the deathHook:
var mob = null; //new global variable called mob
function deathHook(murderer, victim) //new hook and the parameters
{
if(victim==mob) //if statement, if the victim (that dies), is a mob
{
clientMessage("A Mob Has Died."); //client message
}
}
So when a mob dies, it will send a client message.
Sorry if the example(for DeathHook) has any errors but you should get the idea, im writing it at school.
I am pretty sure its actually every 1/20th of a second
ok thx again i will test tommorow cant today if i need help i know where to ask right here inbcomments keep checking them k :)yeah im also gonna use the dewth hook function thig so if you kill A villager a cop villager shall attack you with Diamond Swordlol maybe ill make them invincible!!ok thx again i will test tommorow cant today if i need help i know where to ask right here inbcomments keep checking them k
ok so read the comments darkdiamond miner ima ask and put up scripts tell me if theyll work
function useItem(x, y, z, itemId, blockId, side){ }useItem is a hook that is used if you want a certain event happen when you tap a block or use a item.
function attackHook(attacker, victim){ }AttackHook is a hook that is used if you want a certain event to happen when you hit a mob.
function modTick(){ }ModTick is a hook that is used if you want a certain event to happen using ticks.
Examples:
function useItem(x, y, z, itemId, blockId, side){ if(itemId == 280){ //if item is a stick addItemInventory(264, 64); // add 64 diamonds! } }Example 2:
function attackHook(attacker, victim){ if(getCarriedItem() == 280){ //if item is a stick setVelY(victim, 10); //Make them fly vertically } }Example 3:
var tick = 20; function modTick(){ tick--; //Countdown if(tick == 0){ //If countdown finishes setVelY(victim, 4); //Make the player fly vertically } }Complicated example:
function useItem(x, y, z, itemId, blockId, side){ var x = x; var y = y; var z = z; towerOfGold(); } function towerOfGold(){ for(var i = 0; i < 255; i++){ setTile(x, y+i, z, 41); } }IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
like
function attackHook(attacker, victim){ if(getCarriedItem() == 57){//if item is diamond block //then can i add this if(victim() == zombiePigman){ console.log("Began trade")so i was hoping that that would make it so when i hit a zombie pigman with a diamond block it wil say Began tradeTry this:
function attackHook(attacker, victim){ if(getCarriedItem() == 280){ //Try to change this to something else. Block don't work. Like a stick or something if(Entity.getEntityTypeId() == 36){ //Id of Zombie Pigman is 36. To define a mob use Entity.getEntityTypeId() clientMessage("Trade has started"); } } }IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
well than i so far am working on how to do it
function attackHook(attacker, victim) { if(Entity.getEntityTypeId(victim) == 36) { if(getCarriedItem() == 264) { preventDefault(); clientMessege("New Trade Has Begun") } } }-
View User Profile
-
View Posts
-
Send Message
Curse PremiummodTick runs the code (inside the hook) every 1/4th of a second (Im pretty sure.)
Another (Slightly more advanced) hook is the deathHook:
var mob = null; //new global variable called mob function deathHook(murderer, victim) //new hook and the parameters { if(victim==mob) //if statement, if the victim (that dies), is a mob { clientMessage("A Mob Has Died."); //client message } }So when a mob dies, it will send a client message.
Sorry if the example(for DeathHook) has any errors but you should get the idea, im writing it at school.
Check out my game! It's an open-world, sandbox text adventure.
Follow @hexdro_
Hexdro © 2012-2015
function attackHook(attacker, victim) { if(Entity.getEntityTypeId(victim) == 36) { if(getCarriedItem() == 264) { preventDefault(); clientMessage("New Trade Has Begun") } } }Link:
http://www.minecraft.../#entry29816329
I am pretty sure its actually every 1/20th of a second
Link:
http://www.minecraft.../#entry29816329
Yep. But I think he just wanted to make a simple ModPE script.
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]