This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
Like the title says.
"Its all SHITS and GIGGLES, till someone GIGGLES and SHITS!"
Create an Item (surprising).
Get with modTick() if you hold the item (in the hotbar) (Put in your ID for 50):
var inHand=false;
function modTick(){
if(Player.getInventorySlot(0)==50 || Player.getInventorySlot(1)==50 || Player.getInventorySlot(2)==50 || Player.getInventorySlot(3)==50 || Player.getInventorySlot(4)==50 || Player.getInventorySlot(5)==50 || Player.getInventorySlot(6)==50){
inHand=true;
}else{
inHand=false;
}
Now the variable inHand tells you if you hold the shield. You can use this to reduce damage in attackHook() and...
Yeah, i got that far,but don't know how to make the sheild work...
You could do:
var life=0;
if(inHand==true){
if(life==0){
life=20;
if(Entity.getHealth(getPlayerEnt())<life){
Entity.setHealth(Entity.getHealth(getPlayerEnt())+1);
life=Entity.getHealth(getPlayerEnt());
Thanks, I figured out an easier way now,
function modTick
{
if(Player.getCarriedItem()==490)
var player = Player.getEntity()
Entity.addEffect(player,6,3,4,2,1);
Quote from MrGlassArmorยป Thanks, I figured out an easier way now, function modTick { if(Player.getCarriedItem()==490) { var player = Player.getEntity() Entity.addEffect(player,6,3,4,2,1); } }
Okay.
Like the title says.
"Its all SHITS and GIGGLES, till someone GIGGLES and SHITS!"

-
View User Profile
-
View Posts
-
Send Message
Curse PremiumCreate an Item (surprising).
Get with modTick() if you hold the item (in the hotbar) (Put in your ID for 50):
var inHand=false;
function modTick(){
if(Player.getInventorySlot(0)==50 || Player.getInventorySlot(1)==50 || Player.getInventorySlot(2)==50 || Player.getInventorySlot(3)==50 || Player.getInventorySlot(4)==50 || Player.getInventorySlot(5)==50 || Player.getInventorySlot(6)==50){
inHand=true;
}else{
inHand=false;
}
}
Now the variable inHand tells you if you hold the shield. You can use this to reduce damage in attackHook() and...
Yeah, i got that far,but don't know how to make the sheild work...
"Its all SHITS and GIGGLES, till someone GIGGLES and SHITS!"

-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou could do:
var life=0;
function modTick(){
if(inHand==true){
if(life==0){
life=20;
}else{
if(Entity.getHealth(getPlayerEnt())<life){
Entity.setHealth(Entity.getHealth(getPlayerEnt())+1);
}
}
life=Entity.getHealth(getPlayerEnt());
}
}
Thanks, I figured out an easier way now,
function modTick
{
if(Player.getCarriedItem()==490)
{
var player = Player.getEntity()
Entity.addEffect(player,6,3,4,2,1);
}
}
"Its all SHITS and GIGGLES, till someone GIGGLES and SHITS!"

-
View User Profile
-
View Posts
-
Send Message
Curse PremiumOkay.