How do I create a stamina system using the hunger bar?Minecraft hunger increasing (bar decreasing) whilst AFKkeeping banner on someone's headCounting items in a chestWhy is my attempt at night vision goggles not working?How can I make this checkpoint system work in multiplayer? Minecraft 1.9How to kill someone when a score reaches 0How do I create particles in a mob with an effect?How to create fake players for scoreboards/setup scoreboardEffect others with armorMinecraft 1.13: conditionally apply effect when player holds specific item
What is this "opened" cube called?
Coupling two 15 Amp circuit breaker for 20 Amp
Wrong Stamping of UK Visa
“I hope he visit us more often” Why is this wrong?
Defending Castle from Zombies
Idiomatic way to create an immutable and efficient class in C++?
Cauterizing a wound with metal?
How can I fix cracks between the bathtub and the wall surround?
Do application leftovers have any impact on performance?
In Endgame, wouldn't Stark have remembered Hulk busting out of the stairwell?
Get contents before a colon
How to handle inventory and story of a player leaving
How to investigate an unknown 1.5GB file named "sudo" in my Linux home directory?
Why doesn't Starship have four landing legs?
What caused the end of cybernetic implants?
What is the following VRP?
What checks exist against overuse of presidential pardons in the USA?
How to save money by shopping at a variety of grocery stores?
What is Soda Fountain Etiquette?
Moscow SVO airport, how to avoid scam taxis without pre-booking?
Did ancient peoples ever hide their treasure behind puzzles?
Are spot colors limited and why CMYK mix is not treated same as spot color mix?
Is it recommended to point out a professor's mistake during their lecture?
Why military weather satellites?
How do I create a stamina system using the hunger bar?
Minecraft hunger increasing (bar decreasing) whilst AFKkeeping banner on someone's headCounting items in a chestWhy is my attempt at night vision goggles not working?How can I make this checkpoint system work in multiplayer? Minecraft 1.9How to kill someone when a score reaches 0How do I create particles in a mob with an effect?How to create fake players for scoreboards/setup scoreboardEffect others with armorMinecraft 1.13: conditionally apply effect when player holds specific item
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am trying to create a stamina system for a mini-game, but I just can't seem to get it to work properly. I can't use the exp bar, as that is already being used for a magic bar that I have up and running. I am trying to use the hunger bar. I have gotten the regen feature to work, but the problem is when it comes to draining it. Currently I have it so jumping and sprinting drain your stamina using the hunger effect, the problem though is that when the player jumps it gives them the hunger effect and won't take it away when the stop. The second issue is that it won't give the hunger effect for sprinting as I need to constantly reset it to make sure if the player is resting or sprinting. I want to know if there is a way to test if the player is not moving or just walking. Just testing for those two things would allow me to make the stamina system a lot easier to control.
The scoreboards I am using are:
staminaRegen dummy
staminaUsage stat.sprintOneCm
staminaUsageAir stat.jump
Resting stat.sneakTime
minecraft minecraft-commands
add a comment |
I am trying to create a stamina system for a mini-game, but I just can't seem to get it to work properly. I can't use the exp bar, as that is already being used for a magic bar that I have up and running. I am trying to use the hunger bar. I have gotten the regen feature to work, but the problem is when it comes to draining it. Currently I have it so jumping and sprinting drain your stamina using the hunger effect, the problem though is that when the player jumps it gives them the hunger effect and won't take it away when the stop. The second issue is that it won't give the hunger effect for sprinting as I need to constantly reset it to make sure if the player is resting or sprinting. I want to know if there is a way to test if the player is not moving or just walking. Just testing for those two things would allow me to make the stamina system a lot easier to control.
The scoreboards I am using are:
staminaRegen dummy
staminaUsage stat.sprintOneCm
staminaUsageAir stat.jump
Resting stat.sneakTime
minecraft minecraft-commands
add a comment |
I am trying to create a stamina system for a mini-game, but I just can't seem to get it to work properly. I can't use the exp bar, as that is already being used for a magic bar that I have up and running. I am trying to use the hunger bar. I have gotten the regen feature to work, but the problem is when it comes to draining it. Currently I have it so jumping and sprinting drain your stamina using the hunger effect, the problem though is that when the player jumps it gives them the hunger effect and won't take it away when the stop. The second issue is that it won't give the hunger effect for sprinting as I need to constantly reset it to make sure if the player is resting or sprinting. I want to know if there is a way to test if the player is not moving or just walking. Just testing for those two things would allow me to make the stamina system a lot easier to control.
The scoreboards I am using are:
staminaRegen dummy
staminaUsage stat.sprintOneCm
staminaUsageAir stat.jump
Resting stat.sneakTime
minecraft minecraft-commands
I am trying to create a stamina system for a mini-game, but I just can't seem to get it to work properly. I can't use the exp bar, as that is already being used for a magic bar that I have up and running. I am trying to use the hunger bar. I have gotten the regen feature to work, but the problem is when it comes to draining it. Currently I have it so jumping and sprinting drain your stamina using the hunger effect, the problem though is that when the player jumps it gives them the hunger effect and won't take it away when the stop. The second issue is that it won't give the hunger effect for sprinting as I need to constantly reset it to make sure if the player is resting or sprinting. I want to know if there is a way to test if the player is not moving or just walking. Just testing for those two things would allow me to make the stamina system a lot easier to control.
The scoreboards I am using are:
staminaRegen dummy
staminaUsage stat.sprintOneCm
staminaUsageAir stat.jump
Resting stat.sneakTime
minecraft minecraft-commands
minecraft minecraft-commands
edited Sep 20 '18 at 8:21
Fabian Röling
11.8k3 gold badges20 silver badges51 bronze badges
11.8k3 gold badges20 silver badges51 bronze badges
asked Jan 29 '17 at 20:13
TrueDakkonTrueDakkon
188 bronze badges
188 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
you should reset the objective every time you applied the hunger effect, like so:
/effect @a[score_staminaUsage_min=1] minecraft:hunger 1 1 true
/scoreboard players set @a[score_staminaUsage_min=1] staminaUsage 0
same for the staminaUsageAir
.
this way you can give the hunger effect only when a player sprints or jumps.
Here is another tip: if you're okay with your player regenerating hunger whenever he's not loosing, you could for example put this command on a clock:
/effect @a minecraft:saturation 1 0
this will regenerate half a cone each time it is activated (20 times a second: full bar in one second. once per second: full bar in 40 seconds).
then just put the hunger effect above it while they run (with a high amplifier, like 200) and bam, system complete.
Okay, I like the idea you are going for, but it sounds like they will only receive the effect upon death? If so, that isn't exactly what I am going for. I am trying to make a hunger system so that when the player is doing strenuous movement, such as jumping or sprinting, they are given the hunger effect so that their stamina drains faster. The second idea seems smart. To give them a large hunger effect while sprinting or jumping while they are also constantly receiving a low saturation effect. I will try that and see how it works.
– TrueDakkon
Feb 4 '17 at 7:44
UPDATE: Works really well. I have a clock running every 30 ticks to regen and give them a hunger effect of 100 as to not have it drain super quickly. Now I just need a way to incorporate special moves that drain stamina.
– TrueDakkon
Feb 4 '17 at 8:08
Whoops, I didn't mean to write death in there. Fixed. Also I'm happy that it works for you. :)
– Plagiatus
Feb 5 '17 at 22:12
add a comment |
Although I am incredibly late to this, I might have another option.
With the /bossbar
command added in the Aquatic Update, you can control the bar up top where Withers' and Ender Dragons' health would show up. I don't have any experience using it, although I can tell you that the properties of it are the amount filled (of a configurable maximum) and the color of it.
Oh, also, you can have multiple boss bars for multiple people with different IDs.
New contributor
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgaming.stackexchange.com%2fquestions%2f299274%2fhow-do-i-create-a-stamina-system-using-the-hunger-bar%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
you should reset the objective every time you applied the hunger effect, like so:
/effect @a[score_staminaUsage_min=1] minecraft:hunger 1 1 true
/scoreboard players set @a[score_staminaUsage_min=1] staminaUsage 0
same for the staminaUsageAir
.
this way you can give the hunger effect only when a player sprints or jumps.
Here is another tip: if you're okay with your player regenerating hunger whenever he's not loosing, you could for example put this command on a clock:
/effect @a minecraft:saturation 1 0
this will regenerate half a cone each time it is activated (20 times a second: full bar in one second. once per second: full bar in 40 seconds).
then just put the hunger effect above it while they run (with a high amplifier, like 200) and bam, system complete.
Okay, I like the idea you are going for, but it sounds like they will only receive the effect upon death? If so, that isn't exactly what I am going for. I am trying to make a hunger system so that when the player is doing strenuous movement, such as jumping or sprinting, they are given the hunger effect so that their stamina drains faster. The second idea seems smart. To give them a large hunger effect while sprinting or jumping while they are also constantly receiving a low saturation effect. I will try that and see how it works.
– TrueDakkon
Feb 4 '17 at 7:44
UPDATE: Works really well. I have a clock running every 30 ticks to regen and give them a hunger effect of 100 as to not have it drain super quickly. Now I just need a way to incorporate special moves that drain stamina.
– TrueDakkon
Feb 4 '17 at 8:08
Whoops, I didn't mean to write death in there. Fixed. Also I'm happy that it works for you. :)
– Plagiatus
Feb 5 '17 at 22:12
add a comment |
you should reset the objective every time you applied the hunger effect, like so:
/effect @a[score_staminaUsage_min=1] minecraft:hunger 1 1 true
/scoreboard players set @a[score_staminaUsage_min=1] staminaUsage 0
same for the staminaUsageAir
.
this way you can give the hunger effect only when a player sprints or jumps.
Here is another tip: if you're okay with your player regenerating hunger whenever he's not loosing, you could for example put this command on a clock:
/effect @a minecraft:saturation 1 0
this will regenerate half a cone each time it is activated (20 times a second: full bar in one second. once per second: full bar in 40 seconds).
then just put the hunger effect above it while they run (with a high amplifier, like 200) and bam, system complete.
Okay, I like the idea you are going for, but it sounds like they will only receive the effect upon death? If so, that isn't exactly what I am going for. I am trying to make a hunger system so that when the player is doing strenuous movement, such as jumping or sprinting, they are given the hunger effect so that their stamina drains faster. The second idea seems smart. To give them a large hunger effect while sprinting or jumping while they are also constantly receiving a low saturation effect. I will try that and see how it works.
– TrueDakkon
Feb 4 '17 at 7:44
UPDATE: Works really well. I have a clock running every 30 ticks to regen and give them a hunger effect of 100 as to not have it drain super quickly. Now I just need a way to incorporate special moves that drain stamina.
– TrueDakkon
Feb 4 '17 at 8:08
Whoops, I didn't mean to write death in there. Fixed. Also I'm happy that it works for you. :)
– Plagiatus
Feb 5 '17 at 22:12
add a comment |
you should reset the objective every time you applied the hunger effect, like so:
/effect @a[score_staminaUsage_min=1] minecraft:hunger 1 1 true
/scoreboard players set @a[score_staminaUsage_min=1] staminaUsage 0
same for the staminaUsageAir
.
this way you can give the hunger effect only when a player sprints or jumps.
Here is another tip: if you're okay with your player regenerating hunger whenever he's not loosing, you could for example put this command on a clock:
/effect @a minecraft:saturation 1 0
this will regenerate half a cone each time it is activated (20 times a second: full bar in one second. once per second: full bar in 40 seconds).
then just put the hunger effect above it while they run (with a high amplifier, like 200) and bam, system complete.
you should reset the objective every time you applied the hunger effect, like so:
/effect @a[score_staminaUsage_min=1] minecraft:hunger 1 1 true
/scoreboard players set @a[score_staminaUsage_min=1] staminaUsage 0
same for the staminaUsageAir
.
this way you can give the hunger effect only when a player sprints or jumps.
Here is another tip: if you're okay with your player regenerating hunger whenever he's not loosing, you could for example put this command on a clock:
/effect @a minecraft:saturation 1 0
this will regenerate half a cone each time it is activated (20 times a second: full bar in one second. once per second: full bar in 40 seconds).
then just put the hunger effect above it while they run (with a high amplifier, like 200) and bam, system complete.
edited Feb 21 '18 at 18:13
answered Jan 30 '17 at 20:27
PlagiatusPlagiatus
1,0022 silver badges11 bronze badges
1,0022 silver badges11 bronze badges
Okay, I like the idea you are going for, but it sounds like they will only receive the effect upon death? If so, that isn't exactly what I am going for. I am trying to make a hunger system so that when the player is doing strenuous movement, such as jumping or sprinting, they are given the hunger effect so that their stamina drains faster. The second idea seems smart. To give them a large hunger effect while sprinting or jumping while they are also constantly receiving a low saturation effect. I will try that and see how it works.
– TrueDakkon
Feb 4 '17 at 7:44
UPDATE: Works really well. I have a clock running every 30 ticks to regen and give them a hunger effect of 100 as to not have it drain super quickly. Now I just need a way to incorporate special moves that drain stamina.
– TrueDakkon
Feb 4 '17 at 8:08
Whoops, I didn't mean to write death in there. Fixed. Also I'm happy that it works for you. :)
– Plagiatus
Feb 5 '17 at 22:12
add a comment |
Okay, I like the idea you are going for, but it sounds like they will only receive the effect upon death? If so, that isn't exactly what I am going for. I am trying to make a hunger system so that when the player is doing strenuous movement, such as jumping or sprinting, they are given the hunger effect so that their stamina drains faster. The second idea seems smart. To give them a large hunger effect while sprinting or jumping while they are also constantly receiving a low saturation effect. I will try that and see how it works.
– TrueDakkon
Feb 4 '17 at 7:44
UPDATE: Works really well. I have a clock running every 30 ticks to regen and give them a hunger effect of 100 as to not have it drain super quickly. Now I just need a way to incorporate special moves that drain stamina.
– TrueDakkon
Feb 4 '17 at 8:08
Whoops, I didn't mean to write death in there. Fixed. Also I'm happy that it works for you. :)
– Plagiatus
Feb 5 '17 at 22:12
Okay, I like the idea you are going for, but it sounds like they will only receive the effect upon death? If so, that isn't exactly what I am going for. I am trying to make a hunger system so that when the player is doing strenuous movement, such as jumping or sprinting, they are given the hunger effect so that their stamina drains faster. The second idea seems smart. To give them a large hunger effect while sprinting or jumping while they are also constantly receiving a low saturation effect. I will try that and see how it works.
– TrueDakkon
Feb 4 '17 at 7:44
Okay, I like the idea you are going for, but it sounds like they will only receive the effect upon death? If so, that isn't exactly what I am going for. I am trying to make a hunger system so that when the player is doing strenuous movement, such as jumping or sprinting, they are given the hunger effect so that their stamina drains faster. The second idea seems smart. To give them a large hunger effect while sprinting or jumping while they are also constantly receiving a low saturation effect. I will try that and see how it works.
– TrueDakkon
Feb 4 '17 at 7:44
UPDATE: Works really well. I have a clock running every 30 ticks to regen and give them a hunger effect of 100 as to not have it drain super quickly. Now I just need a way to incorporate special moves that drain stamina.
– TrueDakkon
Feb 4 '17 at 8:08
UPDATE: Works really well. I have a clock running every 30 ticks to regen and give them a hunger effect of 100 as to not have it drain super quickly. Now I just need a way to incorporate special moves that drain stamina.
– TrueDakkon
Feb 4 '17 at 8:08
Whoops, I didn't mean to write death in there. Fixed. Also I'm happy that it works for you. :)
– Plagiatus
Feb 5 '17 at 22:12
Whoops, I didn't mean to write death in there. Fixed. Also I'm happy that it works for you. :)
– Plagiatus
Feb 5 '17 at 22:12
add a comment |
Although I am incredibly late to this, I might have another option.
With the /bossbar
command added in the Aquatic Update, you can control the bar up top where Withers' and Ender Dragons' health would show up. I don't have any experience using it, although I can tell you that the properties of it are the amount filled (of a configurable maximum) and the color of it.
Oh, also, you can have multiple boss bars for multiple people with different IDs.
New contributor
add a comment |
Although I am incredibly late to this, I might have another option.
With the /bossbar
command added in the Aquatic Update, you can control the bar up top where Withers' and Ender Dragons' health would show up. I don't have any experience using it, although I can tell you that the properties of it are the amount filled (of a configurable maximum) and the color of it.
Oh, also, you can have multiple boss bars for multiple people with different IDs.
New contributor
add a comment |
Although I am incredibly late to this, I might have another option.
With the /bossbar
command added in the Aquatic Update, you can control the bar up top where Withers' and Ender Dragons' health would show up. I don't have any experience using it, although I can tell you that the properties of it are the amount filled (of a configurable maximum) and the color of it.
Oh, also, you can have multiple boss bars for multiple people with different IDs.
New contributor
Although I am incredibly late to this, I might have another option.
With the /bossbar
command added in the Aquatic Update, you can control the bar up top where Withers' and Ender Dragons' health would show up. I don't have any experience using it, although I can tell you that the properties of it are the amount filled (of a configurable maximum) and the color of it.
Oh, also, you can have multiple boss bars for multiple people with different IDs.
New contributor
New contributor
answered 54 mins ago
Sleeping OrangeSleeping Orange
1
1
New contributor
New contributor
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgaming.stackexchange.com%2fquestions%2f299274%2fhow-do-i-create-a-stamina-system-using-the-hunger-bar%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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