Ohh sorry , now I reread it, and I tried with same, but static method:
@Subscribe
public static void onLivingDeathEvent (LivingDeathEvent deadEntity){
if ( deadEntity.getSource() == DamageSource.DROWN) {
System.out.println("Entity died: drown");
}
else{
System.out.println("Entity died: other reasons");
}
}
And it still doesn't work - I am confused, why should it be static?
After some debugging I still can't figure out why this code (code below) don't print expected - when print line was outside if, it also didn't work
@Subscribe
public void onLivingDeathEvent (LivingDeathEvent deadEntity){
if ( deadEntity.getSource() == DamageSource.DROWN) {
System.out.println("Entity died: drown");
}
else{
System.out.println("Entity died: other reasons");
}
}
This code is in main class, class is registered to MinecraftForge.EVENT_BUS
Thanks for your time
I want to teleport player somewhere when he had drown, how can I "listen" (detect) for that? For example send "special message" in chat when that happened or anything else.
Does anyone knows for good article for dimensions in Minecraft (something that will help me in creating my own), and probably some basic terrain generation?
I want to specify properties when I create item "JADE", and I tried that with that piece of code above
This is ItemBase code:
package com.saltbeard.potc.items;
import com.saltbeard.potc.PotC;
import net.minecraft.item.Item;
public class ItemBaseMisc extends Item {
public ItemBaseMisc(){
super(new Properties().group(PotC.MISC_TAB));
}
}
This is old code for registering item "JADE":
public static final RegistryObject<Item> JADE = ITEMS.register("jade", ItemBaseMisc::new);