1
NEED HELP BADLY!!!!!!! FOR THE LOVE OF GOD HELP ME!!!!!
So I've made an RPG machine that gives you extra health every time you level up 10 levels... my only issue is that it is constantly giving a player with the proper xp the health boost effect, making it worthless because it doesn't allow you to regen the extra hearts you've obtained when you're given the effect again.
My idea for a solution is for it to scan for a player with a certain amount of xp, and no potion effect, so that when it searches for a player again, the player WITH the potion effect will not be affected. So I tried this:
/effect @a[l=19,ml=10,effect=0] (effect here) (time here) (strength here)
My issue is that I don't know what to put after the effect=!
Please help!
My idea for a solution is for it to scan for a player with a certain amount of xp, and no potion effect, so that when it searches for a player again, the player WITH the potion effect will not be affected. So I tried this:
/effect @a[l=19,ml=10,effect=0] (effect here) (time here) (strength here)
My issue is that I don't know what to put after the effect=!
Please help!
Create an account or sign in to comment.
10
1
When a player has the possibility of getting more health, if you want to give it to the player only once, create a dummy objective, something like "MaxHealth".
First make the health giving command block:
/effect @a[l=19,lm=10,score_MaxHealth=0,score_MaxHealth_min=0] heath_boost 1000000 1 true
then paste this command in a command block attached to it, such that this runs directly after it:
/scoreboard players set @a[l=19,lm=10,score_MaxHealth=0,score_MaxHealth_min=0] MaxHealth 1
so this flags the player immediately and doesn't let it run it again on it. for the second level up from this it would be something like this:
/effect @a[l=29,lm=20,score_MaxHealth=1,score_MaxHealth_min=1] heath_boost 1000000 2 true
/scoreboard players set @a[l=29,lm=20,score_MaxHealth=1,score_MaxHealth_min=1] MaxHealth 2
One thing I must add as well, to make sure the game recognizes that they have a score set on them for MaxHealth, add a command block on a pretty slow clock to do this: /scoreboard players add @a MaxHealth 0
this will make sure the players have the objective in the first place, and will make sure the game keeps track of their positions.
First make the health giving command block:
/effect @a[l=19,lm=10,score_MaxHealth=0,score_MaxHealth_min=0] heath_boost 1000000 1 true
then paste this command in a command block attached to it, such that this runs directly after it:
/scoreboard players set @a[l=19,lm=10,score_MaxHealth=0,score_MaxHealth_min=0] MaxHealth 1
so this flags the player immediately and doesn't let it run it again on it. for the second level up from this it would be something like this:
/effect @a[l=29,lm=20,score_MaxHealth=1,score_MaxHealth_min=1] heath_boost 1000000 2 true
/scoreboard players set @a[l=29,lm=20,score_MaxHealth=1,score_MaxHealth_min=1] MaxHealth 2
One thing I must add as well, to make sure the game recognizes that they have a score set on them for MaxHealth, add a command block on a pretty slow clock to do this: /scoreboard players add @a MaxHealth 0
this will make sure the players have the objective in the first place, and will make sure the game keeps track of their positions.
1
That title though.
1
Yes, it does sound as though someone's hired a hit on you. The police would be a better source of advice than Planet Minecraft
1
Definately
1
Pffft, you could just make a plugin or mod to do this, much easier?
1
Modding would be easier in some cases, but I want to try and make plugins in vanilla Minecraft.
1
The problem here is that there is no such thing as effect for inside the square brackets. Best off using scoreboards to track all players. Then your commands could look like this.
effect @a[score_xp_min=10] heath_boost 1000000 1 true
effect @a[score_xp_min=20] heath_boost 1000000 2 true etc...
effect @a[score_xp_min=10] heath_boost 1000000 1 true
effect @a[score_xp_min=20] heath_boost 1000000 2 true etc...
1
"Every time you level up 10 levels"
Where in that code does it define 10 levels as a variable..
Do you even get an error that you can give us to help you?
Where in that code does it define 10 levels as a variable..
Do you even get an error that you can give us to help you?
1
Idk. Is there a /testfor for xp???!?!?!
1
Just for the record, there is actually a testfor for xp. l= tests for a max level, and lm= tests for a min level. You don't really see it used much anymore, since scoreboard exists now. Before then though, right around the time command blocks were introduced, people used to give different amounts of level to players similar to how you would give scores to people today.