This event is fired whenever potential mob griefing is about to occur. It has a result which determines whether the default behaviour occurs or not:

  • allow: the griefing is allowed
  • deny: the griefing is prevented
  • default: the griefing occurs according to Vanilla logic.

You will need to cast the event in the function header as this class:
crafttweaker.event.MobGriefingEvent
You can, of course, also import the class before and use that name then.

Event interface extensions

Link to event-interface-extensions

MobGriefing Events implement the following interfaces and are able to call all of their methods/getters/setters as well:

ZenGetters/ZenSetters/ZenMethods from extensions

Link to zengetterszensetterszenmethods-from-extensions

The following information can be retrieved/set during the event:

ZenGetterZenSetterType
ZenGetter
entityLivingBase
ZenSetter
Type
IEntityLivingBase
ZenGetter
result
ZenSetter
Type
string with value of default, deny or allow
  • event.deny() Method, sets the event's result to deny
  • event.allow() Method, sets the event's result to allow
  • event.default() Method, sets the event's result to default