QUESTION: How to make block drop specific ITEM when broken by specific TOOL

Started by Sweddy on

Topic category: General discussion

Active 6 years ago
Joined Sep 2013
Points:
903

User statistics:

  • Modifications: 0
  • Forum topics: 32
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 40
QUESTION: How to make block drop specific ITEM when broken by specific TOOL

I need metallic ores, even the vanilla Iron and Gold ones, to drop another item instead of their regular block drop when broken by a specific tool a.k.a a hammer.

Help plz

Active 4 years ago
Joined Dec 2014
Points:
801

User statistics:

  • Modifications: 4
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 61
Hmm... interesting.
Sat, 04/23/2016 - 13:08

Hmm... interesting.

It has to be done with variables. I suggest removing the normal drop or something and play around with variables. For example, if Player Has Item in Hand = Hammer, then drop a specific item or put that item in said player's inventory.

Sorry if I explained that horribly, but hopefully you get my drift.

Active 6 years ago
Joined Sep 2013
Points:
903

User statistics:

  • Modifications: 0
  • Forum topics: 32
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 40
RE:Hmm... interesting.
Sat, 04/23/2016 - 14:08

@#1 

That's not the problem. I need it to do the same with regular ores. Iron and Gold. And I can't edit the properties of vanilla blocks.

Active 12 months ago
Joined Aug 2013
Points:
1162

User statistics:

  • Modifications: 4
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 737
First i don't know why do you
Sat, 04/23/2016 - 17:31

First i don't know why do you make another thread with same topic For second i already gave you tips for what look. : Use "event handler " class. HarvestDropsEvent event.

Event Handler is specific class where you have defined some events. You can use empty GUI overlay for it because it is event handler where is defined something like "GUIScreenRenderEvent". You need instand of it HarvestDropsEvent.
After it you need check if event.block == Blocks.iron_ore and if so , change in ArrayList drops the drop item.

Active 12 months ago
Joined Aug 2013
Points:
1162

User statistics:

  • Modifications: 4
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 737
RE:First i don't know why do you
Sat, 04/23/2016 - 17:39

@#2 If you will need even more info , write me and i will gladly help you but next time please don't make another thread with same topic within few days. :)