How can i make it that when a user executes one of my commands, it startes a 100 tick delay and if the user gets attacked during that time it cancels the delay and the code
MCMatters store the BukkitTask/task I'd (depending on whether you use a BukkitRunnable or the scheduler) and cancel using BukkitTask#cancel() or the cancelTask(id) method from the scheduler