I am trying to make aggressive iron golems which attack players. I understand it is hard to do this, but I also understand players work on popularity to prevent iron golems from attacking(trading changes their anger towards you). Does anyone by chance know how to make aggressive Iron Golems or change the popularity to make them angry at players forever?
I am still designing my map and I would love to be able to detect the time in the day for the following reason:
There is a zombie horde which spawns consistently, but at a certain time in night they will be buffed up with effects and then when it reaches a certain time in the morning they will go back to normal.
I cant find or think of a solution around this. Unfortunately, this is the only solution of which I can provide as I cannot be sure what the commands are for checking status affect.
I used the exact code you posted above, except with my username and the wolfs' name.
I just tested this out and it works perfectly fine. I went onto a different map and copied/pasted my own code. Changed player name to my own and it works perfectly fine. Make sure the code is in repeat/always active.
What you could do instead is test if the animal is alive. If it isnt alive, then it will summon the wolf beside you. So, as soon as it dies another one (duplicate) will spawn.
/execute at (PlayerName) unless entity @e[name=RangersPetWolf, distance=..500] run summon minecraft:wolf ~ ~ ~ {Owner:PlayerName,CustomName:"{\"text\":\"RangersPetWolf\"}"}
Run this on a command block repeat/always active.
It will test if the player has the pet alive and if it doesnt then it will summon the wolf. Careful, be sure the name matches the pet you summon as it will summon constant pets if you do not.
You can either tag two different types of armor stands (or more depending on how many you want) and place them inside each hopper then give all armor stands invisibility. Once the player is near two different armor stands then they would be teleported back.
Thank you both for the advice! Playing around with it all has been super helpful, and I've got things working now, plus I've learned a bunch on the way.
If possible, I would like to be able to hold a charged crossbow and it activate via command block when holding it or any command really to activate it (shoot).
I found a quite easy way around this if you would like to give it a shot.
Simply spawn an armor stand with a tag to it.
Set this command:
execute at @e[type=minecraft:armor_stand] run setblock ~ ~-1 ~ stone (repeat always active)
set a time to give the armor stand levitation for 1 second on 0 amplifier.
It will raise it up and place one block on there. So, you can put the levitation buff on the armor stand every minute and raise it high enough for 1 block to spawn below it. Also make the armor stand invisible.
Did you figure it out, because if you have then I wont try to find a solution (considering you have figured other commands out you were trying to find.)
I do not believe you can disable arrow damage. Even when someone is on the same team as another the arrows which are fired from whoever or summoned will do damage regardless.
What you could try doing is destroying any arrow 1 block away from you and set this in a repeat/always activate block to prevent it from hurting you.
/execute at @a[team=YourTeamName] run kill @e[type=arrow,distance=..3]
..3 = 3 blocks or less from you.
If this helped, please say so and mark this thread as [SOLVED].
Ive tried this out a few times and I got it working, so I believe your issue would be you are using a decimal for the tp. This game works on a single block coordinate. It does not pan out or work when it comes to decimal values when it involved moving something. Remove the decimal.
If this has helped you, let me know and mark this as [SOLVED] when editing the title for the thread.
I know a way, but it maybe not what you are looking for. It is similar, but different. The way I have used for my game would be to detect if a player has an item in his inventory and if he/she does then the command wont activate, but if the player doesnt then it will activate. After the item has been dropped it would then give the player the item back.
/execute at @p unless entity @p[nbt={Inventory:[{id:"minecraft:Your item here"}]}]
Once the item has been dropped, it will activate this (repeat always active) command block and then you have a comparator following it with a redstone right after and then a command block (with what coding you want in it (impulse needs redstone)). After the 2nd block has been activated, you can give back the item with a simple command.
The @p will detect the closest player, so if you are able to then I suggest you try adding each player to a team or tag them and then editing the @p to @a[tag=...] @a[team=...].
I would recommend using the @a[tag=...] instead of team, as it will search all the players in the team and if any of them do have an item then it wont work. This is what I am using and I hope it helps.
Let me know if this worked, if it has and you are satisfied please edit your thread to [SOLVED].
0
I am trying to make aggressive iron golems which attack players. I understand it is hard to do this, but I also understand players work on popularity to prevent iron golems from attacking(trading changes their anger towards you). Does anyone by chance know how to make aggressive Iron Golems or change the popularity to make them angry at players forever?
0
I am still designing my map and I would love to be able to detect the time in the day for the following reason:
There is a zombie horde which spawns consistently, but at a certain time in night they will be buffed up with effects and then when it reaches a certain time in the morning they will go back to normal.
0
I cant find or think of a solution around this. Unfortunately, this is the only solution of which I can provide as I cannot be sure what the commands are for checking status affect.
0
I just tested this out and it works perfectly fine. I went onto a different map and copied/pasted my own code. Changed player name to my own and it works perfectly fine. Make sure the code is in repeat/always active.
1
Well, the armor stands are more for to detect when they are close to too many hoppers, which in return teleport them back as you so want.
As for being able to tell the difference in positions per tick, I am not too sure on how to do that.
0
Can you write down the exact code you used for this?
0
What you could do instead is test if the animal is alive. If it isnt alive, then it will summon the wolf beside you. So, as soon as it dies another one (duplicate) will spawn.
/execute at (PlayerName) unless entity @e[name=RangersPetWolf, distance=..500] run summon minecraft:wolf ~ ~ ~ {Owner:PlayerName,CustomName:"{\"text\":\"RangersPetWolf\"}"}
Run this on a command block repeat/always active.
It will test if the player has the pet alive and if it doesnt then it will summon the wolf. Careful, be sure the name matches the pet you summon as it will summon constant pets if you do not.
Let me know how this works.
0
You can either tag two different types of armor stands (or more depending on how many you want) and place them inside each hopper then give all armor stands invisibility. Once the player is near two different armor stands then they would be teleported back.
0
You're welcome. I appreciate the gratitude.
0
If possible, I would like to be able to hold a charged crossbow and it activate via command block when holding it or any command really to activate it (shoot).
0
I found a quite easy way around this if you would like to give it a shot.
Simply spawn an armor stand with a tag to it.
Set this command:
execute at @e[type=minecraft:armor_stand] run setblock ~ ~-1 ~ stone (repeat always active)
set a time to give the armor stand levitation for 1 second on 0 amplifier.
It will raise it up and place one block on there. So, you can put the levitation buff on the armor stand every minute and raise it high enough for 1 block to spawn below it. Also make the armor stand invisible.
0
Did you figure it out, because if you have then I wont try to find a solution (considering you have figured other commands out you were trying to find.)
0
I do not believe you can disable arrow damage. Even when someone is on the same team as another the arrows which are fired from whoever or summoned will do damage regardless.
What you could try doing is destroying any arrow 1 block away from you and set this in a repeat/always activate block to prevent it from hurting you.
/execute at @a[team=YourTeamName] run kill @e[type=arrow,distance=..3]
..3 = 3 blocks or less from you.
If this helped, please say so and mark this thread as [SOLVED].
0
Ive tried this out a few times and I got it working, so I believe your issue would be you are using a decimal for the tp. This game works on a single block coordinate. It does not pan out or work when it comes to decimal values when it involved moving something. Remove the decimal.
If this has helped you, let me know and mark this as [SOLVED] when editing the title for the thread.
0
I know a way, but it maybe not what you are looking for. It is similar, but different. The way I have used for my game would be to detect if a player has an item in his inventory and if he/she does then the command wont activate, but if the player doesnt then it will activate. After the item has been dropped it would then give the player the item back.
/execute at @p unless entity @p[nbt={Inventory:[{id:"minecraft:Your item here"}]}]
Once the item has been dropped, it will activate this (repeat always active) command block and then you have a comparator following it with a redstone right after and then a command block (with what coding you want in it (impulse needs redstone)). After the 2nd block has been activated, you can give back the item with a simple command.
The @p will detect the closest player, so if you are able to then I suggest you try adding each player to a team or tag them and then editing the @p to @a[tag=...] @a[team=...].
I would recommend using the @a[tag=...] instead of team, as it will search all the players in the team and if any of them do have an item then it wont work. This is what I am using and I hope it helps.
Let me know if this worked, if it has and you are satisfied please edit your thread to [SOLVED].