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

Posted

Hello Guys,

 

I want to change the Harvestlevel from Certus Quartz Ore and Charges Certus Quartz Ore, which are implemented in AE2. But I could need some hints on that. I think i will need the dev environment from AE2.

 

Greets,

 

xXxKanemanxXx

  • Author

But for what would i need the HarvestDropsEvent ? I want to change the HarvestLevel of Certus Quartz Ore so I would be able to mine it only with a Diamond Pickaxe or even higher tier Tools.

  • Author

could need some more hints.

 

So i can use GameRegistry.findBlock to get the block. But how do i check now it its the Block i am currently harvesting ?

You now you need to use an event, so look up how to do events.

You know you need to use

GameRegistry.findBlock

. You need to specify it with the modid of the mod, and the name the block is registered with. Store that block somewhere in a static variable. In the HarvestCheck event, you can get the block, compare it wil the block in that variable, and check if the tool the player (get the player from the event) is holding has the harvest level you want it to have, and then set success to

true

, else you set it to

false

.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author

My question now is how will i check for the tool the player is holding ? Can i use the EntityPlayer.getItemInUse Method or is it another method ?

 

Edit:

 

I've tried it like this. Could this work ?

 

 

@SubscribeEvent

public void onHarvestCheck(PlayerEvent.HarvestCheck check){

if(this.quartzOre == check.block){

if(this.heldItem.getItem() == Items.diamond_pickaxe){

check.success = true;

}else{

check.success = false;

}

}

}

 

 

  • Author

my entire class:

 

 

 

public class HarvestEventHandler {

 

public static Block quartzOre = GameRegistry.findBlock("appliedenergistics2", "oreCertusQuartz");

public static ItemStack heldItem;

@SubscribeEvent

public void onHarvestCheck(PlayerEvent.HarvestCheck check){

if(this.quartzOre == check.block){

if(this.heldItem.getItem() == Items.diamond_pickaxe){

check.success = true;

}else{

check.success = false;

}

}

}

}

 

 

  • Author

i've casted the heldItem variable now.

 

Now i need to cast the findBlock in a static field right ? but which static field and how ?

 

 

 

public void postInit(FMLPostInitializationEvent e){

GameRegistry.findBlock("appliedenergistics2", "oreCertusQuartz");

}

 

@SubscribeEvent

public void onHarvestCheck(PlayerEvent.HarvestCheck check){

ItemStack heldItem = check.entityPlayer.inventory.getCurrentItem();

if(this.quartzOre == check.block){

if(heldItem.getItem() == Items.diamond_pickaxe){

 

}

}

}

 

 

 

i know quartzOre is an undefined variable atm

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

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.