This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
can i ask about code for
- i wanna add a sword or tools but it has enchantments
- and i wanna add a crafting recipe for it
- also i wanna change the name for that tool
Hey, I can help with that.
Here is the code for fire aspect enchantment:
function attackHook(attacker, victim){
if(Player.isPlayer(attacker)&&getCarriedItem()==276){ //276 is the ID of Diamond Sword
Entity.setFireTicks(victim, 5); //You can replace 5 with any number, it is just how many second the fire lasts
}
Here is the code for changing the item name:
ModPE.setItem(276, "diamond_sword", 0, "itemnamehere");
and here is the recipe code:
Item.addCraftRecipe(276, 1, 0, [264, 2, 0, 280, 1, 0]); //That is the regular Diamond Sword recipe.
If you do not quite understand it, or need more help, message me on kik or skype: CheesyMushroom_ (that is my name for both)
can i ask about code for
- i wanna add a sword or tools but it has enchantments
- and i wanna add a crafting recipe for it
- also i wanna change the name for that tool
Hey, I can help with that.
Here is the code for fire aspect enchantment:
function attackHook(attacker, victim){
if(Player.isPlayer(attacker)&&getCarriedItem()==276){ //276 is the ID of Diamond Sword
Entity.setFireTicks(victim, 5); //You can replace 5 with any number, it is just how many second the fire lasts
}
}
Here is the code for changing the item name:
ModPE.setItem(276, "diamond_sword", 0, "itemnamehere");
and here is the recipe code:
Item.addCraftRecipe(276, 1, 0, [264, 2, 0, 280, 1, 0]); //That is the regular Diamond Sword recipe.
If you do not quite understand it, or need more help, message me on kik or skype: CheesyMushroom_ (that is my name for both)