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.

Featured Replies

use the LivingDeathEvent.

use event.source.getEntity() and check if it's an instance of EntityPlayer.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

  • Author

I've tried to make it but it doesn't work.

The event class:

 

 

package com.BI.Events;

 

import com.BI.Items.Mod_Items;

 

import cpw.mods.fml.common.eventhandler.SubscribeEvent;

import net.minecraft.entity.Entity;

import net.minecraft.entity.passive.EntityPig;

import net.minecraft.entity.passive.EntitySquid;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.item.ItemStack;

import net.minecraftforge.event.entity.living.LivingDeathEvent;

public class Drop_Event {

@SubscribeEvent

public void onPlayerKill(LivingDeathEvent event){

if (event.source.getEntity() instanceof EntityPlayer)

{

event.entityLiving.dropItem(Mod_Items.Eye, 1);

}

}

}

 

 

 

Main Class:

 

 

package com.BI.Main_Package;

 

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraftforge.common.MinecraftForge;

import net.minecraftforge.common.util.EnumHelper;

 

import com.BI.Blocks.Mod_Blocks;

import com.BI.Events.Drop_Event;

import com.BI.Items.Mod_Items;

import com.BI.Lib.Reference;

import com.BI.Registers.Game_Registry;

 

import cpw.mods.fml.common.FMLCommonHandler;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.event.FMLInitializationEvent;

 

@Mod(modid = Reference.MOD_ID, version = Reference.MOD_VERSION, name = Reference.MOD_NAME)

public class Main_Class

{

public static CreativeTabs CMTab = new CMTab(CreativeTabs.getNextID(), "Chaos Magic");

public static final Item.ToolMaterial DagerM = EnumHelper.addToolMaterial("DagerM", 3, 151, 12.0F, 3.5F, 22);

    @EventHandler

    public void init(FMLInitializationEvent event)

    {

    System.out.println("Chaos Magic " + Reference.MOD_VERSION + ">> is initializating!");

Mod_Blocks.BlocksInit();

Mod_Items.ItemsInit();

Game_Registry.RegistersInitItems();

Game_Registry.RegistersInitBlocks();

FMLCommonHandler.instance().bus().register(new Drop_Event());

System.out.println("Chaos Magic " + Reference.MOD_VERSION + ">> has succesfully initialized all the modules!");

    }

}

 

 

Woking at my first mod, Blocks & Items Revolution : https://github.com/megabitus98/Blocks-Items-Revolution

Guest
This topic is now closed to further replies.

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.