• Recently Browsing

    No registered users viewing this page.

  • Posts

    • package com.callumwong.sixsomod.events; import com.callumwong.sixsomod.SixSOMod; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.item.Items; import net.minecraft.util.math.BlockPos; import net.minecraftforge.common.extensions.IForgeBlockState; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; @Mod.EventBusSubscriber(modid = SixSOMod.MOD_ID, bus = Bus.FORGE) public class ClickWaterEvent { @SubscribeEvent public static void clickWaterEvent(PlayerInteractEvent.RightClickBlock event) { BlockPos blockPos = event.getPos().offset(event.getFace()); IForgeBlockState state = event.getWorld().getBlockState(blockPos); if (((BlockState) state).getBlock() == Blocks.WATER) { if(player.getCurrentEquuippedItem() != null){ if(player.getCurrentEquippedItem().getItem() == Items.GLASS_BOTTLE){ } } } } }   I am very new to Minecraft Forge, and I am still a beginner at Java. Should I be learning more about Java before I start using Forge?
    • 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • See the comment above the method.
    • What's the context for this code? Do you know Java?
    • Hello, I have been working on a mod that adds a new food item as part of its content. The food gives effects, and I have listed the part of the code that does this:                           //Absorption: 10 hearts for 10 seconds                         .effect(new EffectInstance(Effects.ABSORPTION, 200, 10), 1f)                         //Resistance: Resistance X for 10 seconds                         .effect(new EffectInstance(Effects.RESISTANCE, 200, 10), 1f)                         //Regeneration: Regeneration V for 10 seconds                         .effect(new EffectInstance(Effects.REGENERATION, 200, 4), 1f)                         //Wither: Wither II for 18 seconds                         .effect(new EffectInstance(Effects.WITHER, 380, 2), 1f)   However, eclipse is registering this as a deprecated method. I would like to do things the new and correct way, so if someone could point me to the new way of declaring an effect with custom duration for a food, I would appreciate it. Here is a link to the project on GitHub if you need more clarification on the code: https://github.com/skiprocks999/Amulets-of-Infinity/tree/Item-Library/ContInfItemLib   Thanks in advance!  
  • Topics

  • Who's Online (See full list)