• Recently Browsing

    No registered users viewing this page.

  • Posts

    • really, now it works  thanks you very much!
    • Hey guys, I'm starting to learn Minecraft modding. Can you tell me why the pig keeps dropping just 1 diamons? It doesn't make sense   import net.minecraft.item.Items; import net.minecraft.world.World; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import java.util.Random; @Mod.EventBusSubscriber(modid = tutorialmod.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class entities { @SubscribeEvent public static void pigsDroppingDiam(LivingDropsEvent event) { if (!(event.getEntity() instanceof PigEntity)) { return; } int diam = new Random().nextInt(3)+1; float diam1 = Float.parseFloat(String.valueOf(diam)); System.out.println(diam); if (!event.getEntity().world.isRemote) { event.getEntityLiving().entityDropItem(new ItemStack(Items.DIAMOND), diam1); } }   Main:   package mod.stardev.mod1; import net.minecraftforge.fml.common.Mod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @Mod(tutorialmod.MODID) public final class tutorialmod { public static final String MODID = "tutorialmod"; public static final Logger LOGGER = LogManager.getLogger(MODID); public tutorialmod() { LOGGER.debug("Hello from TutorialMod."); } }
    • ClientTickEvent is fired on the Forge bus, try changing  bus = Mod.EventBusSubscriber.Bus.MOD to bus = Mod.EventBusSubscriber.Bus.FORGE  
    • @vemerion strange, but seems like nothing happens after i added the code.. did i do something wrong? @Mod.EventBusSubscriber(modid = Atmospheric.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) @Mod("atmospheric") public class Atmospheric { public static final String MOD_ID = "atmospheric"; Minecraft minecraft = Minecraft.getInstance(); private static int musicTimer = 10; @SubscribeEvent public static void onTick(TickEvent.ClientTickEvent event) { if (event.phase == TickEvent.Phase.END && event.side == LogicalSide.CLIENT) { if (musicTimer-- <= 0 && Minecraft.getInstance() != null && Minecraft.getInstance().player != null) { musicTimer = 10; Minecraft.getInstance().player.playSound(AtmosphericSoundEvents.SOLACE_1, 2f, 1f); Minecraft.getInstance().getMusicTicker().stop(); } } } }  
    • Sort of. The mounting can still be disabled. Only dismounting is bugged. The issue is that the client does not tick the PlayerEntity unless it is not riding an entity causing the movement flag to always be set to true.
  • Topics

  • Who's Online (See full list)