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

MrSawZ

Members
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

MrSawZ's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Oh yeah, that's work! I have missed "minecraft::" on the documentation. and for the modid, it's a private mod for my server so the conflicts are minimal but that's a good tip, Thanks !
  2. Ok, so i found the solution after some test, i leave the code here if someone wants him if(itemStack.getItem().equals(ModItems.WULFENITE_HELMET) && !player.inventory.armorInventory.get(1).isEmpty() && !player.inventory.armorInventory.get(2).isEmpty() && !player.inventory.armorInventory.get(0).isEmpty()) // CHECK IF FULL ARMOR PUT ON THE PLAYER { if(player.inventory.armorInventory.get(1).getItem().equals(ModItems.WULFENITE_LEGGINGS) && player.inventory.armorInventory.get(2).getItem().equals(ModItems.WULFENITE_CHESTPLATE) && player.inventory.armorInventory.get(0).getItem().equals(ModItems.WULFENITE_BOOTS)) // CHECK IF BOOTS LEGGINGS AND CHESTPLATE IS YOURS { player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 20, 0)); } }
  3. Hello, I have created a recipe for the golden apple data 1 in my mod but i got this error: [00:56:42] [main/ERROR] [FML]: Parsing error loading recipe sm:gap com.google.gson.JsonSyntaxException: Unknown recipe type: sm:crafting_shaped at net.minecraftforge.common.crafting.CraftingHelper.getRecipe(CraftingHelper.java:407) ~[CraftingHelper.class:?] at net.minecraftforge.common.crafting.CraftingHelper.lambda$loadRecipes$22(CraftingHelper.java:711) ~[CraftingHelper.class:?] at net.minecraftforge.common.crafting.CraftingHelper.findFiles(CraftingHelper.java:822) ~[CraftingHelper.class:?] at net.minecraftforge.common.crafting.CraftingHelper.loadRecipes(CraftingHelper.java:668) ~[CraftingHelper.class:?] at java.util.ArrayList.forEach(Unknown Source) [?:1.8.0_201] at net.minecraftforge.common.crafting.CraftingHelper.loadRecipes(CraftingHelper.java:620) [CraftingHelper.class:?] at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:742) [Loader.class:?] at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:581) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] Here's my recipe: { "type": "crafting_shaped", "pattern": [ "#D#", "DGD", "#D#" ], "key": { "#": { "item": "minecraft:gold_block" }, "D": { "item": "minecraft:diamond_block" }, "G": { "item": "minecraft:golden_apple", "data": 0 } }, "result": { "item": "minecraft:golden_apple", "data": 1, "count": 1 } } Can you help me, please? :c
  4. Ok so i change : entitylivingbase.addPotionEffect(new PotionEffect(Potion.getPotionById(16), 20, 0)); with this entitylivingbase.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 5, 1)); there is no error in my code but when i put my "Wulfenite Helmet" I have no effects given to me I think the helmet check on the "EntityEquipmentSlot.HEAD" doesn't work public void onArmorTick(World world, EntityLivingBase entitylivingbase, ItemStack itemStack) { ItemStack helmet = entitylivingbase.getItemStackFromSlot(EntityEquipmentSlot.HEAD); if(helmet.getItem() == ModItems.WULFENITE_HELMET) { entitylivingbase.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 5, 1)); } }
  5. I do this but it doesn't work public void onArmorTick(World world, EntityLivingBase entitylivingbase, ItemStack itemStack) { ItemStack helmet = entitylivingbase.getItemStackFromSlot(EntityEquipmentSlot.HEAD); if(helmet.getItem() == ModItems.WULFENITE_HELMET) { entitylivingbase.addPotionEffect(new PotionEffect(Potion.getPotionById(16), 20, 0)); } } I tried to search on the internet, but i only found a little piece of code I didn't know how i can do this, i have no more idea
  6. Hello! I tried to add an effect when i wear my armor so i try some line of codes: @Override public void onArmorTick(World world, EntityPlayer player, ItemStack item) { if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ModItems.WULFENITE_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ModItems.WULFENITE_LEGGINGS && player.inventory.armorItemInSlot(2).getItem() == ModItems.WULFENITE_CHESTPLATE && player.inventory.armorItemInSlot(3).getItem() == ModItems.WULFENITE_HELMET) { player.addPotionEffect(new PotionEffect(Potion.getPotionById(16), 20, 0)); } } } Or @Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { if (player.inventory.armorItemInSlot(3) != null && player.inventory.armorItemInSlot(3).getItem() == ModItems.WULFENITE_HELMET && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(2).getItem() == ModItems.WULFENITE_CHESTPLATE && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(1).getItem() == ModItems.WULFENITE_LEGGINGS && player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(0).getItem() == ModItems.WULFENITE_BOOTS) { player.addPotionEffect(new PotionEffect(MobEffects.WATER_BREATHING, 40, 4, false, false)); } } They work perfectly in Solo, but when i join my SpongeForge server 1.12.2 with my mod, and i wear my armor i get disconnect with the message "Internal Server Error" In the console, there's this error: net.minecraft.util.ReportedException: Ticking player at net.minecraft.entity.player.EntityPlayerMP.func_71127_g(EntityPlayerMP.java:459) ~[oq.class:?] at net.minecraft.network.NetHandlerPlayServer.redirect$onPlayerTick$zjb000(NetHandlerPlayServer.java:2056) ~[pa.class:?] at net.minecraft.network.NetHandlerPlayServer.func_73660_a(NetHandlerPlayServer.java:173) ~[pa.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.func_73660_a(NetworkDispatcher.java:209) ~[NetworkDispatcher$1.class:?] at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:285) ~[gw.class:?] at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:180) [oz.class:?] at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:790) [MinecraftServer.class:?] at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:397) [nz.class:?] at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212] Caused by: java.lang.NoSuchMethodError: net.minecraft.entity.player.InventoryPlayer.func_70440_f(I)Lnet/minecraft/item/ItemStack; at fr.mrsawz.sawzmod.items.armor.ArmorBase.onArmorTick(ArmorBase.java:71) ~[ArmorBase.class:?] at net.minecraft.entity.player.InventoryPlayer.func_70429_k(InventoryPlayer.java:371) ~[aec.class:?] at net.minecraft.entity.player.EntityPlayer.func_70636_d(EntityPlayer.java:511) ~[aed.class:?] at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2179) ~[vp.class:?] at net.minecraft.entity.player.EntityPlayer.func_70071_h_(EntityPlayer.java:234) ~[aed.class:?] at net.minecraft.entity.player.EntityPlayerMP.func_71127_g(EntityPlayerMP.java:382) ~[oq.class:?] ... 10 more [11:08:16]: [NetHandlerPlayServer] MrSawZ lost connection: Internal server error I don't know why and i didn't found any pieces of information on the internet. Can you help me, please?
×
×
  • Create New...

Important Information

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