First you need useItem and a variable to create the boss
var boss
function useItem(x,y,z,itemID,blockID)
{
if(itemID ==280)
{
boss = Level.spawnMob(Player.getX(),Player.getY(),Player.getZ(), 39,"mob/boss.png);
Entity.setRenderType(boss, 3);
Entity.setNameTag(boss, "Boss");
Entity.setHealth(boss, 50);
}
}
function AttackHook(attacker,victim)
{
if(victim ==boss)
{
clientMessage("<boss>: ow!");
}
}
function DeathHook(murderer,victim)
{
if(victim ==boss)
{
clientMessage("<boss>: nooooo!");
Player.addItemInventory(57, 10, 0);
}
}
This just means when you tap a block with a stick a boss will spawn, mob/boss.png needs a texture pack containing a
Image called boss.png, and when you hit the boss he will say ow. And when you kill the boss he will say nooooo, and give you 10 diamond blocks, and here is a download link for a example boss mod, make sure to turn on the texture pack.
First you need useItem and a variable to create the boss
var boss
function useItem(x,y,z,itemID,blockID)
{
if(itemID ==280)
{
boss = Level.spawnMob(Player.getX(),Player.getY(),Player.getZ(), 39,"mob/boss.png);
Entity.setRenderType(boss, 3);
Entity.setNameTag(boss, "Boss");
Entity.setHealth(boss, 50);
}
}
function AttackHook(attacker,victim)
{
if(victim ==boss)
{
clientMessage("<boss>: ow!");
}
}
function DeathHook(murderer,victim)
{
if(victim ==boss)
{
clientMessage("<boss>: nooooo!");
Player.addItemInventory(57, 10, 0);
}
}
This just means when you tap a block with a stick a boss will spawn, mob/boss.png needs a texture pack containing a
Image called boss.png, and when you hit the boss he will say ow. And when you kill the boss he will say nooooo, and give you 10 diamond blocks, and here is a download link for a example boss mod, make sure to turn on the texture pack.
Note: the screenshots are from the example mod.
https://www.dropbox.com/s/6pa3f7nxijvhp29/Example mod and texture pack.zip?dl=0
I will add this to my ModPE Tutorials thread! Change the title to begin with TUTORIAL:, otherwise people will think you are asking for help.
I clicked here for that very reason.
lol
You should use:
Level.dropItem(Entity.getX(boss), Entity.getY(boss), Entity.getZ(boss), 1, 57, 10, 0);
This would make the boss drop the diamonds, instead of just adding it into your inventory.
oh.