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.

Melon9191

Members
  • Joined

  • Last visited

  1. Thank you this method worked. Where do you recommend me to learn Java?
  2. Like I said before I am new so alot of this is just lack of experience but once I paste the code into a new class what do I do? package com.melon9191.platinummod.init; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class ItemEffect extends Item { public ItemEffect(Item.Properties builder) { super(builder); } public boolean hasEffect(ItemStack stack) { return true; } }
  3. so do I add @Override public boolean hasEffect(ItemStack stack) { return true; } to a new class then
  4. This is what I got from that, but it isn't working. I made a new class in init and wrote this up. Sorry I'm just learning and getting a grasp on everything! package com.melon9191.platinummod.init; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class ItemEffect extends Item { public ItemEffect(Properties hasEffect) { super(hasEffect); } @Override public boolean hasEffect(ItemStack platinum_enchantedapple) { return platinum_enchantedapple.isEnchanted(); } }
  5. I am learning how to make mods. For my Hello World project I chose to make a platinum mod? How would I add the enchant effect to an Enchanted Platinum Apple. Thank you in advance. Here is my code: package com.melon9191.platinummod.init; import com.melon9191.platinummod.PlatinumMod; import com.melon9191.platinummod.PlatinumMod.PlatinumItemGroup; import net.minecraft.item.Food; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.potion.EffectInstance; import net.minecraft.potion.Effects; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; import net.minecraftforge.registries.ObjectHolder; @Mod.EventBusSubscriber(modid = PlatinumMod.MOD_ID, bus = Bus.MOD) @ObjectHolder(PlatinumMod.MOD_ID) public class ItemInit { public static final Item platinum_ingot = null; public static final Item platinum_apple = null; public static final Item platinum_enchantedapple = null; @SubscribeEvent public static void registerItems(final RegistryEvent.Register<Item> event) { event.getRegistry().register(new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName("platinum_ingot")); event.getRegistry().register(new Item(new Item.Properties().group(PlatinumItemGroup.instance).food(new Food.Builder().hunger(5).saturation(1.3f).setAlwaysEdible().effect(new EffectInstance(Effects.STRENGTH, 3000, 1), 1f).effect(new EffectInstance(Effects.ABSORPTION, 3000, 1), 1f).effect(new EffectInstance(Effects.REGENERATION, 3000, 2), 1f).effect(new EffectInstance(Effects.RESISTANCE, 3000, 0), 1f).build())).setRegistryName("platinum_apple")); event.getRegistry().register(new Item(new Item.Properties().group(PlatinumItemGroup.instance).food(new Food.Builder().hunger(6).saturation(1.4f).setAlwaysEdible().effect(new EffectInstance(Effects.STRENGTH, 3600, 2), 1f).effect(new EffectInstance(Effects.ABSORPTION, 3600, 3), 1f).effect(new EffectInstance(Effects.REGENERATION, 3600, 3), 1f).effect(new EffectInstance(Effects.RESISTANCE, 3600, 2), 1f).effect(new EffectInstance(Effects.FIRE_RESISTANCE, 3600, 0), 1f).effect(new EffectInstance(Effects.GLOWING, 3600, 0), 1f).build())).setRegistryName("platinum_enchantedapple")); } }
  6. Melon9191 joined the community
  7. I just started learning how to mod and I am very confused. My mod is simply adding platinum to the game as a hello world type of project. I am learning about block properties and I think that my platinum block should be able to be the base of a beacon. I have seen many things on the internet but they don't seem to work. Can someone please help me by showing me what I should insert into my code and what it means so I can learn from this. I would be very appreciative of your time and work. Below is my code for my specific Platinum Block class: package com.Melon9191.PlatinumMod.blocks; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.world.World; import net.minecraft.block.*; public class PlatinumBlock extends BlockBase { public PlatinumBlock(String name, Material material) { super(name, material); setCreativeTab(CreativeTabs.BUILDING_BLOCKS); setSoundType(SoundType.METAL); setHardness(5.5F); setResistance(30.0F); setHarvestLevel("pickaxe", 2); } } Thank you for whatever answers you can give me!

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.