Need to create custom event trigger (1.7.9)

Started by proxerater on

Topic category: Help with MCreator software

Joined Mar 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Need to create custom event trigger (1.7.9)

Short question, can you make custom event triggers? I want to make my event trigger "play breaks block" and then select my modded block.

Please help!

 

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
As it is your custom block,…
Tue, 07/31/2018 - 08:57

As it is your custom block, all you have to do is override Block#onBlockDestroyedByPlayer() or Block#removedByPlayer() in your blocks class, depending on your needs. I am quite sure that one of them should be accessible from the block creation menu but I may be wrong.
If it was not your block, you would have to make an event handler and subscribe to BlockEvent.BreakEvent.

Joined Jan 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is there any to do the same,…
Sun, 08/05/2018 - 19:19

Is there any to do the same, but to a mob?

What I mean is, a player kills a certain mob that triggers an event?

Thanks