mirror of
https://github.com/ACGaming/Spackenmobs
synced 2024-05-19 11:54:25 +02:00
21 lines
791 B
Java
21 lines
791 B
Java
package mod.acgaming.spackenmobs.events;
|
|
|
|
import mod.acgaming.spackenmobs.misc.ModItems;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.init.MobEffects;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.potion.PotionEffect;
|
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
import net.minecraftforge.fml.common.gameevent.TickEvent.PlayerTickEvent;
|
|
|
|
public class SurstroemmingSmellsBadEvent {
|
|
@SubscribeEvent
|
|
public void onEvent(PlayerTickEvent event) {
|
|
if(event.player != null) {
|
|
EntityPlayer player = event.player;
|
|
if(player.inventory.hasItemStack(new ItemStack(ModItems.SURSTROEMMING))) {
|
|
player.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 100));
|
|
}
|
|
}
|
|
}
|
|
} |