kingsoul
This commit is contained in:
parent
2b2f00a73c
commit
d8ebb6e36a
@ -1,12 +0,0 @@
|
||||
package net.serenas.shitmod.charms;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class kingsoul extends Item {
|
||||
|
||||
public kingsoul(Settings settings) {
|
||||
super(settings);
|
||||
//TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
}
|
38
src/main/java/net/serenas/shitmod/kingsoul.java
Normal file
38
src/main/java/net/serenas/shitmod/kingsoul.java
Normal file
@ -0,0 +1,38 @@
|
||||
package net.serenas.shitmod;
|
||||
|
||||
import net.minecraft.entity.effect.StatusEffect;
|
||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.TypedActionResult;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class kingsoul extends Item {
|
||||
|
||||
public kingsoul(Settings settings) {
|
||||
super(settings);
|
||||
|
||||
}
|
||||
@Override
|
||||
public TypedActionResult<ItemStack> use(World world, PlayerEntity playerentity, Hand hand) {
|
||||
boolean kingSoulActive = false;
|
||||
|
||||
if (kingSoulActive == true) {
|
||||
kingSoulActive = false;
|
||||
} else if (kingSoulActive == false) {
|
||||
kingSoulActive = true;
|
||||
}
|
||||
|
||||
return new TypedActionResult<ItemStack>(ActionResult.SUCCESS, playerentity.getStackInHand(hand));
|
||||
|
||||
}
|
||||
@Override
|
||||
public void
|
||||
if (kingSoulActive == true) {
|
||||
return new kingsoulEffect();
|
||||
}
|
||||
}
|
||||
|
25
src/main/java/net/serenas/shitmod/kingsoulEffect.java
Normal file
25
src/main/java/net/serenas/shitmod/kingsoulEffect.java
Normal file
@ -0,0 +1,25 @@
|
||||
package net.serenas.shitmod;
|
||||
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.effect.StatusEffect;
|
||||
import net.minecraft.entity.effect.StatusEffectCategory;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
||||
public class kingsoulEffect extends StatusEffect{
|
||||
|
||||
public kingsoulEffect() {
|
||||
super(StatusEffectCategory.BENEFICIAL, 0x98D982);
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean canApplyUpdateEffect(int duration, int amplifier) {
|
||||
return true;
|
||||
}
|
||||
PlayerEntity playerentity;
|
||||
@Override
|
||||
public void applyUpdateEffect(LivingEntity entity, int amplifier) {
|
||||
if (entity instanceof PlayerEntity) {
|
||||
playerentity.getHungerManager().add(1, 1);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user