Jump to content

updating my mod from 1.7 to 1.8 need help


Recommended Posts

Hey I have this mod that I made back in 1.7 and I wanted to update it to 1.8 and so I believe that with a little changing I fixed most of the problems but there are still some in one class that I don't know how to fix.

package net.glassDrops.mod;

import java.util.Random;

import net.minecraft.block.BlockGlass;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.event.world.BlockEvent.BreakEvent;

public class glassDrop  {

public void blockBreak(BreakEvent evt){

	if (evt.block == Blocks.glass){
		EntityItem item = new EntityItem(evt.world, evt.x, evt.y, evt.z, new ItemStack(Item.getItemFromBlock(Blocks.glass)));
		EntityPlayer player = evt.getPlayer();

		if(!player.capabilities.isCreativeMode) evt.world.spawnEntityInWorld(item);


The problems are with the evt.block and evt.x, evt.y, and evt.z It has bloxk x y and z underlined and says they cannot be resolved or is not a field. Can someone help me get that fixed?

Link to comment
Share on other sites


Do what diesieben07 said... the block positions provided in the event.

public void blockBreak(BreakEvent evt)
EntityItem item = new EntityItem(evt.world, evt.pos.getX(), evt.pos.getY(), evt.pos.getZ(), new ItemStack(Item.getItemFromBlock(Blocks.glass)));

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

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