public LuckPermsEvent newInstance(LuckPerms api, Object... properties) throws Throwable {
        if (properties.length != this.setters.length) {
            throw new IllegalStateException("Unexpected number of properties. given: " + properties.length + ", expected: " + this.setters.length);
        }

        // create a new instance of the event
        final AbstractEvent event = (AbstractEvent) this.constructor.invokeExact(api);

        // set the properties onto the event instance
        for (int i = 0; i < this.setters.length; i++) {
            MethodHandle setter = this.setters[i];
            Object value = properties[i];
            setter.invokeExact(event, value);
        }

        return event;
    }
Creates a new instance of the event class.

@param api an instance of the LuckPerms API
@param properties the event properties
@return the event instance
@throws Throwable if something goes wrong
common/src/main/java/me/lucko/luckperms/common/event/gen/GeneratedEventClass.java