Jump to content

Recommended Posts

Posted

Hello, I am searching for a way to modify the default ore xp drop values. This is going to be part of a fix based mod to add difficulty, and would like to remove all xp drops from ores. Does anyone have any hints as to how I would go about doing this?

Posted

My only problem as of now, is checking if the block is, (Coal ore, Iron Ore, etc...).

 

I would think that it would be something like this, but it's not.

 

if (event.block.getBlock == Blocks.coal_ore) {
    // Do This
}

Posted

I know it's not getBlock, it was what I would think it would be for simplicity. When using Event.block.*, I'm not sure what the next part is,

 

What I am looking for is to get the original ores, and set their xp drop to 0. Once I am able to get one block, the others won't be a problem.

Posted

So, diesieben07:

 

Would this be the correct way of going about it?

@SubscribeEvent
public void brokeBlock(BreakEvent event) {
	if (event.block instanceof BlockOre) {
		event.setExpToDrop(0);
	}
}

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.

Guest
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.

Announcements



×
×
  • Create New...

Important Information

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