Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Izzymandias

Members
  • Joined

  • Last visited

Everything posted by Izzymandias

  1. Okay; the only thing I'm not understanding about that explanation then, is why it didn't work before I implemented IForgeItem, but current works after Implementing it. Was I missing an import or something?
  2. So would implementing Item would work the same for this purpose as implementing IForgeItem would?
  3. Ah, I did some searching and found it, cheers. Just for future reference (for anyone who's been googling around trying to find it) your class must not only "extends ArmorItem" but also "implements IForgeItem." Then, the order of onArmorTicks' properties is (Itemstack, World, PlayerEntity) Here's my code package com.izzymandias.AttackOfTheMushroomsMod.items.armor; import com.izzymandias.AttackOfTheMushroomsMod.lists.ItemList; import net.minecraft.entity.MobEntity; 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.util.ActionResult; import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.world.World; import net.minecraftforge.common.extensions.IForgeItem; public class spore_leather_boots extends ArmorItem implements IForgeItem{ public spore_leather_boots(IArmorMaterial materialIn, EquipmentSlotType slot, Properties builder) { super(materialIn, slot, builder); } @Override public void onArmorTick(ItemStack itemStack, World world, PlayerEntity entity) { ItemStack boots = entity.getItemStackFromSlot(EquipmentSlotType.FEET); if(boots.getItem() == ItemList.spore_leather_boots) { EffectInstance statusEffect = new EffectInstance(Effects.SPEED, 40, 0); entity.addPotionEffect(statusEffect); } } }
  4. Hi there, I am making some modded armour that gives the player a potion effect whilst worn. Multiple tutorials (which I imagine are outdated, unless I am making an error here) suggest using "onArmorTick". My question is, does this method still exist, and if not, how else can I implement this feature? Here is my modded armour class; package com.izzymandias.AttackOfTheMushroomsMod.items.armor; import com.izzymandias.AttackOfTheMushroomsMod.lists.ItemList; import net.minecraft.entity.LivingEntity; 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 spore_leather_boots extends ArmorItem { public spore_leather_boots(IArmorMaterial materialIn, EquipmentSlotType slot, Properties builder) { super(materialIn, slot, builder); } public void onArmorTick(World world, LivingEntity entity, ItemStack itemStack) { ItemStack boots = entity.getItemStackFromSlot(EquipmentSlotType.FEET); if(boots.getItem() == ItemList.spore_leather_boots) { EffectInstance statusEffect = new EffectInstance(Effects.SPEED, 40, 0); entity.addPotionEffect(statusEffect); } } } Any help would be appreciated, thanks!
  5. Ah, I figured it out! my /src/main/resources/data/[mod]/ path needed the ModID, not the Mod Name. Changing it from AttackOfTheMushroomsMod to aotmm (the ModID) worked - now drops, both vanilla and otherwise, are functioning. Cheers for your help!
  6. Right, it is definitely something to do with the data I inputted, as removing the src/main/resources/data folder entire has allowed the game to function correctly again. Here's the code for my custom loot table JSON; { "type": "minecraft:block", "pools": [ { "name": "aotmm:pool_blue_mushroom", "rolls": 1, "entries": [ { "type": "minecraft:item", "name": "aotmm:blue_mushroom" } ], "conditions": [ { "condition": "minecraft:survives_explosion" } ] } ] } And my custom recipe JSON; { "type": "minecraft:crafting_shaped", "pattern": [ "###", "#x#", "###" ], "key": { "x": { "tag": "minecraft:leather" } "#": { "tag": "aotmm:blue_mushroom" } }, "result": { "item": "aotmm:spore_leather" } } My source files also had this path, if this could have caused a problem; /src/main/resources/data/AttackOfTheMushroomsMod/recipes/ & /src/main/resources/data/AttackOfTheMushroomsMod/loot_tables/blocks/ It's possible the error comes from using my full mod name (AttackOfTheMushroomsMod) rather than my ModID (aotmm) as a subfolder within /data/? Otherwise, I'm not too sure what needs to be fixed
  7. Okay, that sucks - would you suggest a clean re-install of Forge & Gradle then? Or is there any way to check what part isn't working?
  8. Hi there, I'm currently implementing loot tables to some of my modded items, when I noticed that, even in survival, no items are dropping, not even vanilla ones. For example, I tried on several different worlds to break grass or trees, but no items were dropped; I started test worlds in both creative and survival and nothing changed. This appears to only be happening in my mod dev client (I checked through a Minecraft launcher running forge and no other mods and blocks dropped normally) so I'm presuming its an issue related to my Mod. Any advice would be appreciated - I don't know what code would be revelant to add here so if you need to see some please just ask, thank you! Edit; I did some continued testing, and this issue appears to have occurred even before I tried to implement custom loot tables. I've still got no idea what's causing it though... Edit 2; It also affects recipes - I was unable to make any recipes, vanilla or otherwise. I did some searching on Google and tried to use /datapack disable (my mod name) but the command didn't appear to work - whenever I tried to re-enable it, it claimed that the Mod was already enabled, suggesting it was never properly disabled when the disable command was first used. Again, still no idea what's causing this.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.