private void injectEntity() throws Exception {
        // get the CraftEntity class
        Class<?> entityClass = CraftBukkitImplementation.obcClass("entity.CraftEntity");

        // get the method used to obtain a PermissibleBase
        // this method will initialise a new PB instance if one doesn't yet exist
        Method getPermissibleBaseMethod = entityClass.getDeclaredMethod("getPermissibleBase");
        getPermissibleBaseMethod.setAccessible(true);

        // get the PermissibleBase instance
        PermissibleBase permBase = (PermissibleBase) getPermissibleBaseMethod.invoke(null);

        // get the perm field on CraftEntity
        Field permField = entityClass.getDeclaredField("perm");
        permField.setAccessible(true);

        // create a new instance which delegates to the previous PermissibleBase
        PermissibleBase newPermBase = transform(permBase, "internal/entity");
        if (newPermBase == null) {
            return;
        }

        // inject the new instance
        permField.set(null, newPermBase);
    }
Injects {@link MonitoredPermissibleBase}s into non-player permissibles on
the server so their checks can be monitored by the verbose facility.
bukkit/src/main/java/me/lucko/luckperms/bukkit/inject/permissible/PermissibleMonitoringInjector.java