Well I guess I worded that wrong. How exactly did you do it with the ChestShop plugin you made? I read the code but couldnt find it.
$event->setCancelled(); on the InventoryTransactionEvent event? EDIT: yupp https://github.com/Muqsit/ChestShop/blob/master/src/ChestShop/EventListener.php#L74
*Sigh* I know inventory transaction can be canceled. How do i check if they opened it from an inventory or got the gui via command
Why the *sigh*. All you asked was how to cancel the event if opened from a fake gui. You didn't make any other distinction and made no mention of the gui being opened by commands. Be more clear in your original post next time, then you won't get answers you already knew.
https://github.com/Muqsit/ChestShop/blob/master/src/ChestShop/EventListener.php#L63 This line checks for that.
@Muqsit any help? Im trying to do it like yu did with chest shop. I registered everything but its not cancelling