Creating a double-jump mechanic in Minecraft using commands












0















I am trying to make double jumping, i.e. jumping again in midair but only once before you hit the ground again. Hitting the ground should reset you to allow another double jump to happen.



What I've got so far doesn't quite work. Is anyone able to have a look?



Here is my code:



a repeating command block with



/scoreboard players set @a[scores={sneak=1}] sneak 0


leading into another repeating command block with conditional on with



/execute at @a[scores={sneak=1,double=0}] if block ~ ~-0.75 ~ air run effect give @p[scores={sneak=1}] minecraft:levitation 1 0 true


which finally leads into another conditional repeating command block with



execute at @a if block ~ ~-0.5 ~ air run effect clear @a minecraft:levitation


which ends that chain.



there are other commands than reset scores when needed, such as



execute at @a if block ~ ~-0.5 ~ air run scoreboard players set @p[scores={sneak=..1}] sneak 0


along with



execute at @a unless block ~ ~-0.5 ~ air run scoreboard players set @p[scores={double=..1}] double 0


But this isn't working. Can I have some help please?










share|improve this question









New contributor




Sebastian Becker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Hi Sebastian, can you tell us what 'doesn't work'? What exactly happens when you attempt a double jump?

    – Robotnik
    18 hours ago
















0















I am trying to make double jumping, i.e. jumping again in midair but only once before you hit the ground again. Hitting the ground should reset you to allow another double jump to happen.



What I've got so far doesn't quite work. Is anyone able to have a look?



Here is my code:



a repeating command block with



/scoreboard players set @a[scores={sneak=1}] sneak 0


leading into another repeating command block with conditional on with



/execute at @a[scores={sneak=1,double=0}] if block ~ ~-0.75 ~ air run effect give @p[scores={sneak=1}] minecraft:levitation 1 0 true


which finally leads into another conditional repeating command block with



execute at @a if block ~ ~-0.5 ~ air run effect clear @a minecraft:levitation


which ends that chain.



there are other commands than reset scores when needed, such as



execute at @a if block ~ ~-0.5 ~ air run scoreboard players set @p[scores={sneak=..1}] sneak 0


along with



execute at @a unless block ~ ~-0.5 ~ air run scoreboard players set @p[scores={double=..1}] double 0


But this isn't working. Can I have some help please?










share|improve this question









New contributor




Sebastian Becker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Hi Sebastian, can you tell us what 'doesn't work'? What exactly happens when you attempt a double jump?

    – Robotnik
    18 hours ago














0












0








0








I am trying to make double jumping, i.e. jumping again in midair but only once before you hit the ground again. Hitting the ground should reset you to allow another double jump to happen.



What I've got so far doesn't quite work. Is anyone able to have a look?



Here is my code:



a repeating command block with



/scoreboard players set @a[scores={sneak=1}] sneak 0


leading into another repeating command block with conditional on with



/execute at @a[scores={sneak=1,double=0}] if block ~ ~-0.75 ~ air run effect give @p[scores={sneak=1}] minecraft:levitation 1 0 true


which finally leads into another conditional repeating command block with



execute at @a if block ~ ~-0.5 ~ air run effect clear @a minecraft:levitation


which ends that chain.



there are other commands than reset scores when needed, such as



execute at @a if block ~ ~-0.5 ~ air run scoreboard players set @p[scores={sneak=..1}] sneak 0


along with



execute at @a unless block ~ ~-0.5 ~ air run scoreboard players set @p[scores={double=..1}] double 0


But this isn't working. Can I have some help please?










share|improve this question









New contributor




Sebastian Becker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I am trying to make double jumping, i.e. jumping again in midair but only once before you hit the ground again. Hitting the ground should reset you to allow another double jump to happen.



What I've got so far doesn't quite work. Is anyone able to have a look?



Here is my code:



a repeating command block with



/scoreboard players set @a[scores={sneak=1}] sneak 0


leading into another repeating command block with conditional on with



/execute at @a[scores={sneak=1,double=0}] if block ~ ~-0.75 ~ air run effect give @p[scores={sneak=1}] minecraft:levitation 1 0 true


which finally leads into another conditional repeating command block with



execute at @a if block ~ ~-0.5 ~ air run effect clear @a minecraft:levitation


which ends that chain.



there are other commands than reset scores when needed, such as



execute at @a if block ~ ~-0.5 ~ air run scoreboard players set @p[scores={sneak=..1}] sneak 0


along with



execute at @a unless block ~ ~-0.5 ~ air run scoreboard players set @p[scores={double=..1}] double 0


But this isn't working. Can I have some help please?







minecraft minecraft-commands






share|improve this question









New contributor




Sebastian Becker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Sebastian Becker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 18 hours ago









Robotnik

27.2k42126224




27.2k42126224






New contributor




Sebastian Becker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Feb 15 at 1:46









Sebastian BeckerSebastian Becker

42




42




New contributor




Sebastian Becker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Sebastian Becker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Sebastian Becker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Hi Sebastian, can you tell us what 'doesn't work'? What exactly happens when you attempt a double jump?

    – Robotnik
    18 hours ago



















  • Hi Sebastian, can you tell us what 'doesn't work'? What exactly happens when you attempt a double jump?

    – Robotnik
    18 hours ago

















Hi Sebastian, can you tell us what 'doesn't work'? What exactly happens when you attempt a double jump?

– Robotnik
18 hours ago





Hi Sebastian, can you tell us what 'doesn't work'? What exactly happens when you attempt a double jump?

– Robotnik
18 hours ago










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "41"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Sebastian Becker is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgaming.stackexchange.com%2fquestions%2f346550%2fcreating-a-double-jump-mechanic-in-minecraft-using-commands%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








Sebastian Becker is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Sebastian Becker is a new contributor. Be nice, and check out our Code of Conduct.













Sebastian Becker is a new contributor. Be nice, and check out our Code of Conduct.












Sebastian Becker is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Arqade!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgaming.stackexchange.com%2fquestions%2f346550%2fcreating-a-double-jump-mechanic-in-minecraft-using-commands%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Fluorita

Hulsita

Península de Txukotka