Need to create custom event trigger (1.7.9)

Started by proxerater on Tue, 07/31/2018 - 06:51

Topic category: Help with MCreator software

Last seen on 01:48, 11. Oct 2020
Joined Mar 2014
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Need to create custom event trigger (1.7.9)
Tue, 07/31/2018 - 06:51

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!

 

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.

Last seen on 01:48, 11. Oct 2020
Joined Mar 2014
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
thanks!
Wed, 08/01/2018 - 01:45

thanks!

Last seen on 16:14, 8. Sep 2018
Joined Jan 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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