src/main/java/com/github/klikli_dev/occultism/util/EntityUtil.java
/**
     * Creates an entity from the given nbt tag
     *
     * @param world          the world to create the entity in.
     * @param nbtTagCompound the tag compound to create the entity from.
     * @return the entity if successful or null otherwise.
     */
Creates an entity from the given nbt tag
@param world          the world to create the entity in.
@param nbtTagCompound the tag compound to create the entity from.
@return the entity if successful or null otherwise.
Creates an entity from the given nbt tag @param world the world to create the entity in . @param nbtTagCompound the tag compound to create the entity from . @return the entity if successful or null otherwise .
public static Entity entityFromNBT(World world, CompoundNBT nbtTagCompound) {
        ResourceLocation typeId = new ResourceLocation(nbtTagCompound.getString("id"));
        Entity entity = ForgeRegistries.ENTITIES.getValue(typeId).create(world);
        entity.deserializeNBT(nbtTagCompound);
        return entity;
    }
public static Entity entityFromNBT ( World world , CompoundNBT nbtTagCompound ) { ResourceLocation typeId = new ResourceLocation ( nbtTagCompound . getString ( "id" ) ) ; Entity entity = ForgeRegistries . ENTITIES . getValue ( typeId ) . create ( world ) ; entity . deserializeNBT ( nbtTagCompound ) ; return entity ; }
Creates an entity from the given nbt tag
 @param world          the world to create the entity in.
Creates an entity from the given nbt tag @param world the world to create the entity in .