Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

vassdeniss

Members
  • Posts

    65
  • Joined

  • Last visited

Everything posted by vassdeniss

  1. Yes it does even though every other class use the same line
  2. Ingredient.of doesn't exist for me? The pig class is: this.goalSelector.addGoal(4, new TemptGoal(this, 1.2D, Ingredient.fromItems(Items.CARROT_ON_A_STICK), false)); I have Ingredient.fromItems() but that gives me a "Cannot resolve constructor" error. Also how would taming work?
  3. How would i be able to make an entity follow the player on holding a specific item and how to make it follow the player always when given the item. I can't find which functions to use can I get a hand?
  4. I wanted to port one of my mods on 1.7 but when creating an item the name and texture don't show up. I have no idea why I am certain that my file structure is correct! Please help. I uploaded my code in the main class, the item class, the file structure and the en_US.lang file
  5. I assume this is wha you mean? I just want to be sure. @Override public void onArmorTick(ItemStack stack, World world, PlayerEntity player) { ItemStack boots = player.getItemStackFromSlot(EquipmentSlotType.FEET); ItemStack legs = player.getItemStackFromSlot(EquipmentSlotType.LEGS); ItemStack chest = player.getItemStackFromSlot(EquipmentSlotType.CHEST); ItemStack helmet = player.getItemStackFromSlot(EquipmentSlotType.HEAD); if (boots != null && boots.getItem() == RegistryHandler.RU_BOOTS.get() && legs != null && legs.getItem() == RegistryHandler.RU_LEGGINGS.get() && chest != null && chest.getItem() == RegistryHandler.RU_CHESTPLATE.get() && helmet != null && helmet.getItem() == RegistryHandler.RU_HELMET.get()) { player.addPotionEffect(new EffectInstance(Effects.SPEED, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.JUMP_BOOST, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.HASTE, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.NIGHT_VISION, 10)); player.addPotionEffect(new EffectInstance(Effects.WATER_BREATHING)); } else if (boots != null && boots.getItem() == RegistryHandler.MAKO_BOOTS.get() && legs != null && legs.getItem() == RegistryHandler.MAKO_LEGGINGS.get() && chest != null && chest.getItem() == RegistryHandler.MAKO_CHESTPLATE.get() && helmet != null && helmet.getItem() == RegistryHandler.MAKO_HELMET.get()) { player.addPotionEffect(new EffectInstance(Effects.SPEED, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.JUMP_BOOST, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.HASTE, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.NIGHT_VISION, 10)); player.addPotionEffect(new EffectInstance(Effects.WATER_BREATHING)); } }
  6. A few weeks ago I made custom armor for my mod and after finally being able to craft it in my server my friend placed it on causing a crash. I have no idea idea what's the issue. I tried some things myslef but nothing worked. Help appriicated! I've attached the relevant crash report alongside my ArmorHelmet class as stated in the crash report. package com.vassdeniss.makoru.items; import com.vassdeniss.makoru.util.RegistryHandler; import net.minecraft.enchantment.Enchantments; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ArmorItem; import net.minecraft.item.IArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.potion.EffectInstance; import net.minecraft.potion.Effects; import net.minecraft.world.World; public class ArmorHelmet extends ArmorItem { public ArmorHelmet(IArmorMaterial materialIn, EquipmentSlotType slot, Properties builderIn) { super(materialIn, slot, builderIn); } @Override public void onCreated(ItemStack stack, World worldIn, PlayerEntity playerIn) { super.onCreated(stack, worldIn, playerIn); stack.addEnchantment(Enchantments.PROTECTION, 4); stack.addEnchantment(Enchantments.MENDING, 1); stack.addEnchantment(Enchantments.UNBREAKING, 3); stack.addEnchantment(Enchantments.THORNS, 3); stack.addEnchantment(Enchantments.RESPIRATION, 3); stack.addEnchantment(Enchantments.AQUA_AFFINITY, 1); } @Override public void onArmorTick(ItemStack stack, World world, PlayerEntity player) { ItemStack boots = player.inventory.armorItemInSlot(0); ItemStack legs = player.inventory.armorItemInSlot(1); ItemStack chest = player.inventory.armorItemInSlot(2); ItemStack helmet = player.inventory.armorItemInSlot(3); if (boots != null && boots.getItem() == RegistryHandler.RU_BOOTS.get() && legs != null && legs.getItem() == RegistryHandler.RU_LEGGINGS.get() && chest != null && chest.getItem() == RegistryHandler.RU_CHESTPLATE.get() && helmet != null && helmet.getItem() == RegistryHandler.RU_HELMET.get()) { player.addPotionEffect(new EffectInstance(Effects.SPEED, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.JUMP_BOOST, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.HASTE, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.NIGHT_VISION, 10)); player.addPotionEffect(new EffectInstance(Effects.WATER_BREATHING)); } else if (boots != null && boots.getItem() == RegistryHandler.MAKO_BOOTS.get() && legs != null && legs.getItem() == RegistryHandler.MAKO_LEGGINGS.get() && chest != null && chest.getItem() == RegistryHandler.MAKO_CHESTPLATE.get() && helmet != null && helmet.getItem() == RegistryHandler.MAKO_HELMET.get()) { player.addPotionEffect(new EffectInstance(Effects.SPEED, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.JUMP_BOOST, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.HASTE, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.NIGHT_VISION, 10)); player.addPotionEffect(new EffectInstance(Effects.WATER_BREATHING)); } } } latest.log
  7. Yup that was exactly it! It's all good now! Thank you! I didn't even looked at those 2 classes
  8. I saw that in the tutorial i was watching. Oh but wait Only in client means that it will not work on the server side i presume? That must be the problem I was looking for.
  9. If you do ask for the first ModArmorMaterial its the same only diffrent values package com.vassdeniss.makoru.armor; import com.vassdeniss.makoru.MakoRuMod; import com.vassdeniss.makoru.util.RegistryHandler; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.IArmorMaterial; import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvents; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import java.util.function.Supplier; public enum ModArmorMaterial2 implements IArmorMaterial { LOVE(MakoRuMod.MOD_ID + ":love2", 100, new int[] { 5, 5, 5, 5 }, 25, SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE, 4.0F, () -> { return Ingredient.fromItems(RegistryHandler.MAKO_INGOT_ENCHANTED.get()); }); private static final int[] MAX_DAMAGE_ARRAY = new int[] { 11, 16, 15, 13 }; private final String name; private final int maxDamageFactor; private final int[] damageReductionAmountArray; private final int enchantability; private final SoundEvent sound; private final float toughness; private final Supplier<Ingredient> repairMaterial; ModArmorMaterial2(String name, int maxDamageFactor, int[] damageReductionAmountArray, int enchantability, SoundEvent sound, float toughness, Supplier<Ingredient> repairMaterial) { this.name = name; this.maxDamageFactor = maxDamageFactor; this.damageReductionAmountArray = damageReductionAmountArray; this.enchantability = enchantability; this.sound = sound; this.toughness = toughness; this.repairMaterial = repairMaterial; } @Override public int getDurability(EquipmentSlotType slotIn) { return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor; } @Override public int getDamageReductionAmount(EquipmentSlotType slotIn) { return this.damageReductionAmountArray[slotIn.getIndex()]; } @Override public int getEnchantability() { return this.enchantability; } @Override public SoundEvent getSoundEvent() { return this.sound; } @Override public Ingredient getRepairMaterial() { return this.repairMaterial.get(); } @Override public String getName() { return this.name; } @OnlyIn(Dist.CLIENT) @Override public float getToughness() { return this.toughness; } @Override public float getKnockbackResistance() { return 0.2F; } }
  10. Gotcha package com.vassdeniss.makoru.util; import com.vassdeniss.makoru.MakoRuMod; import com.vassdeniss.makoru.armor.ModArmorMaterial; import com.vassdeniss.makoru.armor.ModArmorMaterial2; import com.vassdeniss.makoru.items.*; import com.vassdeniss.makoru.tools.ModItemTier; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ArmorItem; import net.minecraft.item.Item; import net.minecraft.item.SwordItem; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class RegistryHandler { public static DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MakoRuMod.MOD_ID); public static void init() { ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); } // Items public static final RegistryObject<Item> REDSTONE_INGOT = ITEMS.register("redstone_ingot", ItemBase::new); public static final RegistryObject<Item> EMERALD_INGOT = ITEMS.register("emerald_ingot", ItemBase::new); public static final RegistryObject<Item> DIAMOND_INGOT = ITEMS.register("diamond_ingot", ItemBase::new); public static final RegistryObject<Item> DIAMOND_INGOT_ENCHANTED = ITEMS.register("diamond_ingot_enchanted", GlowItem::new); public static final RegistryObject<Item> OWANGE_INGOT = ITEMS.register("owange_ingot", ItemBase::new); public static final RegistryObject<Item> MAKO_INGOT = ITEMS.register("mako_ingot", ItemBase::new); public static final RegistryObject<Item> MAKO_INGOT_ENCHANTED = ITEMS.register("mako_ingot_enchanted", GlowItem::new); public static final RegistryObject<Item> RU_INGOT = ITEMS.register("ru_ingot", ItemBase::new); public static final RegistryObject<Item> RU_INGOT_ENCHANTED = ITEMS.register("ru_ingot_enchanted", GlowItem::new); public static final RegistryObject<Item> PINK_CRYSTAL = ITEMS.register("pink_crystal", ItemBase::new); public static final RegistryObject<Item> PURPLE_CRYSTAL = ITEMS.register("purple_crystal", ItemBase::new); public static final RegistryObject<Item> RU_ESSENSE = ITEMS.register("ru_essense", ItemBase::new); public static final RegistryObject<Item> MAKO_ESSENSE = ITEMS.register("mako_essense", ItemBase::new); public static final RegistryObject<Item> DIAMOND_ESSENSE = ITEMS.register("diamond_essense", GlowItem::new); public static final RegistryObject<Item> RU_BREATH = ITEMS.register("ru_breath", ItemBase::new); public static final RegistryObject<Item> RED_HEART = ITEMS.register("red_heart", GlowItem::new); public static final RegistryObject<Item> ORANGE_HEART = ITEMS.register("orange_heart", GlowItem::new); public static final RegistryObject<Item> GREEN_HEART = ITEMS.register("green_heart", GlowItem::new); public static final RegistryObject<Item> TRIFORCE = ITEMS.register("triforce", Triforce::new); public static final RegistryObject<Item> ROSE = ITEMS.register("rose", Rose::new); // Tools public static final RegistryObject<SwordItem> MAKO_SWORD = ITEMS.register("mako_sword", () -> new MakoSword(ModItemTier.LOVE, 14, -1.0F, new Item.Properties().group(MakoRuMod.TAB)) ); public static final RegistryObject<SwordItem> RU_SWORD = ITEMS.register("ru_sword", () -> new RuSword(ModItemTier.LOVE, 15, -2.0F, new Item.Properties().group(MakoRuMod.TAB)) ); // Armor public static final RegistryObject<ArmorItem> RU_HELMET = ITEMS.register("ru_helmet", () -> new ArmorHelmet(ModArmorMaterial.LOVE, EquipmentSlotType.HEAD, new Item.Properties().group(MakoRuMod.TAB)) ); public static final RegistryObject<ArmorItem> RU_CHESTPLATE = ITEMS.register("ru_chestplate", () -> new ArmorChest(ModArmorMaterial.LOVE, EquipmentSlotType.CHEST, new Item.Properties().group(MakoRuMod.TAB)) ); public static final RegistryObject<ArmorItem> RU_LEGGINGS = ITEMS.register("ru_leggings", () -> new ArmorLeggings(ModArmorMaterial.LOVE, EquipmentSlotType.LEGS, new Item.Properties().group(MakoRuMod.TAB)) ); public static final RegistryObject<ArmorItem> RU_BOOTS = ITEMS.register("ru_boots", () -> new ArmorBoots(ModArmorMaterial.LOVE, EquipmentSlotType.FEET, new Item.Properties().group(MakoRuMod.TAB)) ); public static final RegistryObject<ArmorItem> MAKO_HELMET = ITEMS.register("mako_helmet", () -> new ArmorHelmet(ModArmorMaterial2.LOVE, EquipmentSlotType.HEAD, new Item.Properties().group(MakoRuMod.TAB)) ); public static final RegistryObject<ArmorItem> MAKO_CHESTPLATE = ITEMS.register("mako_chestplate", () -> new ArmorChest(ModArmorMaterial2.LOVE, EquipmentSlotType.CHEST, new Item.Properties().group(MakoRuMod.TAB)) ); public static final RegistryObject<ArmorItem> MAKO_LEGGINGS = ITEMS.register("mako_leggings", () -> new ArmorLeggings(ModArmorMaterial2.LOVE, EquipmentSlotType.LEGS, new Item.Properties().group(MakoRuMod.TAB)) ); public static final RegistryObject<ArmorItem> MAKO_BOOTS = ITEMS.register("mako_boots", () -> new ArmorBoots(ModArmorMaterial2.LOVE, EquipmentSlotType.FEET, new Item.Properties().group(MakoRuMod.TAB)) ); }
  11. Thank god you replied! You solved all the other problems i had with your answers made in the past Here it is package com.vassdeniss.makoru.items; import com.vassdeniss.makoru.util.RegistryHandler; import net.minecraft.enchantment.Enchantments; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ArmorItem; import net.minecraft.item.IArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.potion.EffectInstance; import net.minecraft.potion.Effects; import net.minecraft.world.World; public class ArmorHelmet extends ArmorItem { public ArmorHelmet(IArmorMaterial materialIn, EquipmentSlotType slot, Properties builderIn) { super(materialIn, slot, builderIn); } @Override public void onCreated(ItemStack stack, World worldIn, PlayerEntity playerIn) { super.onCreated(stack, worldIn, playerIn); stack.addEnchantment(Enchantments.PROTECTION, 4); stack.addEnchantment(Enchantments.MENDING, 1); stack.addEnchantment(Enchantments.UNBREAKING, 3); stack.addEnchantment(Enchantments.THORNS, 3); stack.addEnchantment(Enchantments.RESPIRATION, 3); stack.addEnchantment(Enchantments.AQUA_AFFINITY, 1); } @Override public void onArmorTick(ItemStack stack, World world, PlayerEntity player) { ItemStack boots = player.inventory.armorItemInSlot(0); ItemStack legs = player.inventory.armorItemInSlot(1); ItemStack chest = player.inventory.armorItemInSlot(2); ItemStack helmet = player.inventory.armorItemInSlot(3); if (boots.getItem() == RegistryHandler.RU_BOOTS.get() && legs.getItem() == RegistryHandler.RU_LEGGINGS.get() && chest.getItem() == RegistryHandler.RU_CHESTPLATE.get() && helmet.getItem() == RegistryHandler.RU_HELMET.get()) { player.addPotionEffect(new EffectInstance(Effects.SPEED, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.JUMP_BOOST, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.HASTE, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.NIGHT_VISION, 10)); player.addPotionEffect(new EffectInstance(Effects.WATER_BREATHING)); } else if (boots.getItem() == RegistryHandler.MAKO_BOOTS.get() && legs.getItem() == RegistryHandler.MAKO_LEGGINGS.get() && chest.getItem() == RegistryHandler.MAKO_CHESTPLATE.get() && helmet.getItem() == RegistryHandler.MAKO_HELMET.get()) { player.addPotionEffect(new EffectInstance(Effects.SPEED, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.JUMP_BOOST, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.HASTE, 10, 2)); player.addPotionEffect(new EffectInstance(Effects.NIGHT_VISION, 10)); player.addPotionEffect(new EffectInstance(Effects.WATER_BREATHING)); } } }
  12. Hello, i have made myself a minecraft mod a month ago maybe and slowly learning how to make mods. It was all flying colors until i got a server error when testing the mod and I tried to read the log and debug it myslef but to no avail. I also tried surfing here for an answer also to no avail. So i am asking if anyone can lend me a hand please? I will attach the log file. latest.log
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.