/** * PlayerInteractEvent.EntityInteract handler. * <p> * Check, if a player right clicked an entity. * Deny if: * - If the entity is in colony * - player has not permission * * @param event PlayerInteractEvent */ @SubscribeEvent public void on(final PlayerInteractEvent.EntityInteract event) { if (isFreeToInteractWith(null, event.getPos()) && colony.getPermissions().hasPermission(event.getEntityPlayer(), Action.ACCESS_FREE_BLOCKS)) { return; } checkEventCancelation(Action.RIGHTCLICK_ENTITY, event.getEntityPlayer(), event.getWorld(), event, event.getPos()); }