How to Stop the Usage of a Jump

I’m making a movement system for my game in which you can do a wall jump. I’ve found that this requires an extra jump to be available so you can get height (my object is set to have Character physics). Is there any way to stop this jump from happening when not kicking off of a wall? I just need to know if there is a way to cancel a jump, and, if so, how to do it. I’d know how to set it up.

property on the wall
ray on player checking for the property
if ray.positive, double jump else single jump

Can you really just control the number of jumps you can use that easily?

simple answer yes.

but this is just for double jump when hittng an object with that property. if you want/need more jumps use an int property and count the jumps you have done by adding +1 to the property, then if property < 5 etc. so then you have 5 jumps max

On pressing jump key, raycast on global minus z to determine if you’re on solid ground.
Allow initial jump only if raycast returns true,
then if raycast returns false, check for nearby walls.

For instance,

allowJump = [True if character_isOnGround else collision_check][0]
if allowJump:
    doJump()

Note that the jump has to elevate the character above the reach of the raycast right on the first frame, in order to avoid getting false positives.