mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 10:14:43 +02:00
Entities that target endermite no longer give XP (credits to TheBentoBox for the tip)
This commit is contained in:
@ -53,6 +53,17 @@ public class EntityListener implements Listener {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onEntityTargetEntity(EntityTargetLivingEntityEvent event)
|
||||
{
|
||||
//Prevent entities from giving XP if they target endermite
|
||||
if(event.getTarget() instanceof Endermite)
|
||||
{
|
||||
if(event.getTarget().getMetadata(mcMMO.entityMetadataKey) == null || event.getTarget().getMetadata(mcMMO.entityMetadataKey).size() <= 0)
|
||||
event.getTarget().setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onEntityShootBow(EntityShootBowEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
|
Reference in New Issue
Block a user