Better mobGriefing GameRule

Better mobGriefing GameRule

848k Downloads

Handle Wither mobGriefing rule within LivingUpdateEvent event

Judge40 opened this issue ยท 1 comments

commented

Currently, the mobGriefing game rule handling which decides whether a Wither entity should destroy blocks around itself it done in an AI task.
This was done as the value of the block break cooldown had to be tracked uniquely to the entity in order for the default behaviour to be override and it still trigger at the correct time. As the entity is registered in the AI task it gave easy access to everything required.

This is no longer required as the same functionality could be achieved using the LivingUpdateEvent, using similar techniques as those used to implement #6, where the cooldown value is stored in the entity NBT data.
The AI task should be removed and the behaviour handling should instead be handled in the LivingUpdateEvent handler.

commented

This approach requires duplication of OOTB code, which increases the amount of maintenance required. As such the ASM transformation will continue to handle this functionality.