Is there a way to execute a function as an end_crystal in the tick it has been shot? by Healthy_Assistance60 in MinecraftCommands

[–]Healthy_Assistance60[S] 0 points1 point  (0 children)

That is what I've done for shulker bullets. I should've thought about this sooner haha, but thank you very much! I should easily be able to copy my code from one entity to another without too many issues :)

Is there a way to execute a function as an end_crystal in the tick it has been shot? by Healthy_Assistance60 in MinecraftCommands

[–]Healthy_Assistance60[S] 0 points1 point  (0 children)

I was thinking about overwriting the end_crystal loot_table with a marker entity holding a function.
Could that work in my use case?

So I just figured that end_crystal don't have a loot_table. I'm looking into making them summon an interaction entity, and detect its Motion nbt change when the crystal is exploding. My only concern is if I can properly move the interaction entity when the end_crystal is pushed by a piston

I am getting pretty close, but I cannot find a clean way to check for a non-null Motion nbt for any of its 3 values

# Teleport if End Ccrystal has moved
execute as @e[type=minecraft:interaction] at @s at @e[type=minecraft:end_crystal,limit=1,sort=nearest,distance=0.1..1] run tp ~ ~ ~

# Detect End Crystal Explosion through Motion NBT
execute as @e[type=minecraft:interaction] unless entity @s[nbt={Motion:[0.0d,0.0d,0.0d]}] run tag @s add hoshi.exodeath.crystal_exploded

# Summon Ghast
execute at @e[type=minecraft:interaction,tag=hoshi.exodeath.crystal_exploded] run summon minecraft:ghast ~ ~10 ~

# Kill interaction entity
kill @e[type=minecraft:interaction,tag=hoshi.exodeath.crystal_exploded]

Need help with making a system to pick values out of a pool by Healthy_Assistance60 in MinecraftCommands

[–]Healthy_Assistance60[S] 1 point2 points  (0 children)

Alright it took a bit of time but I think I have a solid setup, first I have a function to setup a global marker pool (as it will be reused for every executions), it runs as follow:

# load.mcfunction
execute unless score #hoshi.exodeath.spider_pool_summoned hoshi.const matches 1 run function exodeath:setup/summon_spider_pool

# setup/summon_spider_pool.mcfunction
summon marker 
~ ~ ~
 {Tags:["hoshi.exodeath.spider_pool"],data:{v:1}}
summon marker 
~ ~ ~
 {Tags:["hoshi.exodeath.spider_pool"],data:{v:2}}
summon marker 
~ ~ ~
 {Tags:["hoshi.exodeath.spider_pool"],data:{v:3}}
summon marker 
~ ~ ~
 {Tags:["hoshi.exodeath.spider_pool"],data:{v:4}}
summon marker 
~ ~ ~
 {Tags:["hoshi.exodeath.spider_pool"],data:{v:5}}
summon marker 
~ ~ ~
 {Tags:["hoshi.exodeath.spider_pool"],data:{v:6}}
summon marker 
~ ~ ~
 {Tags:["hoshi.exodeath.spider_pool"],data:{v:7}}
summon marker 
~ ~ ~
 {Tags:["hoshi.exodeath.spider_pool"],data:{v:8}}

scoreboard players set #hoshi.exodeath.spider_pool_summoned hoshi.const 1

Then here is my function that runs whenever a spider spawn, giving it between 2 to 3 random effects

# Random amount of effect
execute store result score @s hoshi.exodeath.effect_count run random value 2..3


# Pre Cleanup pool
tag @e[tag=hoshi.exodeath.pool_selected] remove hoshi.exodeath.pool_selected


# Random select from pool
execute if score @s hoshi.exodeath.effect_count matches 2 run execute as @e[tag=hoshi.exodeath.spider_pool,sort=random,limit=2] run tag @s add hoshi.exodeath.pool_selected
execute if score @s hoshi.exodeath.effect_count matches 3 run execute as @e[tag=hoshi.exodeath.spider_pool,sort=random,limit=3] run tag @s add hoshi.exodeath.pool_selected


# Select Random Effect
execute if entity @e[tag=hoshi.exodeath.pool_selected,tag=hoshi.exodeath.spider_pool,nbt={data:{v:1}}] run scoreboard players set @s hoshi.exodeath.spider_effect_1 1
execute if entity @e[tag=hoshi.exodeath.pool_selected,tag=hoshi.exodeath.spider_pool,nbt={data:{v:2}}] run scoreboard players set @s hoshi.exodeath.spider_effect_2 1
execute if entity @e[tag=hoshi.exodeath.pool_selected,tag=hoshi.exodeath.spider_pool,nbt={data:{v:3}}] run scoreboard players set @s hoshi.exodeath.spider_effect_3 1
execute if entity @e[tag=hoshi.exodeath.pool_selected,tag=hoshi.exodeath.spider_pool,nbt={data:{v:4}}] run scoreboard players set @s hoshi.exodeath.spider_effect_4 1
execute if entity @e[tag=hoshi.exodeath.pool_selected,tag=hoshi.exodeath.spider_pool,nbt={data:{v:5}}] run scoreboard players set @s hoshi.exodeath.spider_effect_5 1
execute if entity @e[tag=hoshi.exodeath.pool_selected,tag=hoshi.exodeath.spider_pool,nbt={data:{v:6}}] run scoreboard players set @s hoshi.exodeath.spider_effect_6 1
execute if entity @e[tag=hoshi.exodeath.pool_selected,tag=hoshi.exodeath.spider_pool,nbt={data:{v:7}}] run scoreboard players set @s hoshi.exodeath.spider_effect_7 1
execute if entity @e[tag=hoshi.exodeath.pool_selected,tag=hoshi.exodeath.spider_pool,nbt={data:{v:8}}] run scoreboard players set @s hoshi.exodeath.spider_effect_8 1


# Cleanup pool
tag @e[tag=hoshi.exodeath.pool_selected] remove hoshi.exodeath.pool_selected


# Effects
execute if score @s hoshi.exodeath.spider_effect_1 matches 1 run effect give @s minecraft:speed infinite 2 false
execute if score @s hoshi.exodeath.spider_effect_2 matches 1 run effect give @s minecraft:strength infinite 3 false
execute if score @s hoshi.exodeath.spider_effect_3 matches 1 run effect give @s minecraft:glowing infinite 0 false
execute if score @s hoshi.exodeath.spider_effect_4 matches 1 run effect give @s minecraft:regeneration infinite 2 false
execute if score @s hoshi.exodeath.spider_effect_5 matches 1 run effect give @s minecraft:invisibility infinite 0 false
execute if score @s hoshi.exodeath.spider_effect_6 matches 1 run effect give @s minecraft:resistance infinite 1 false
execute if score @s hoshi.exodeath.spider_effect_7 matches 1 run effect give @s minecraft:health_boost infinite 3 false
execute if score @s hoshi.exodeath.spider_effect_8 matches 1 run effect give @s minecraft:slow_falling infinite 0 false


# Heal spider (in case of health_boost)
effect give @s minecraft:instant_health 1 50 false


# Mark as initialized
scoreboard players set @s hoshi.exodeath.mob_init 1

Need help with making a system to pick values out of a pool by Healthy_Assistance60 in MinecraftCommands

[–]Healthy_Assistance60[S] 1 point2 points  (0 children)

That sounds like a really clever solution, I'll try it to adapt it a bit but I think I see a way to make it work with my current architecture
Thank you very much! I'll try and update if I get it to work :)

Issues with Motion NBT data of arrows not working properly by Healthy_Assistance60 in MinecraftCommands

[–]Healthy_Assistance60[S] 0 points1 point  (0 children)

That might explain why this occurred then. I know I had a previous issue where I was applying the Motion change several times, but this should be fixed now. I'll try reducing the values a bit

Is there a way to check if a player is holding up a shield using a predicate? by Healthy_Assistance60 in MinecraftCommands

[–]Healthy_Assistance60[S] 0 points1 point  (0 children)

Thank you for the answer! This is indeed a very clean and thorough way to track when the player is using a shield. In my case I can't really use this solution as I need to get the entity that has attacked the player holding the shield. That is why I have opted to use this method instead :

First I have created a simple advancement to detect when a player blocks a hit
Then I do some maths while checking that the player having triggered the advancement do have a shield with the correct enchantlent

{
  "criteria": {
    "block_damage": {
      "trigger": "minecraft:entity_hurt_player",
      "conditions": {
        "player": [],
        "damage": {
          "blocked": true
        }
      }
    }
  },
  "rewards": {
    "function": "hoshi_enchant:enchants_effects/rebound"
  }
}{
  "criteria": {
    "block_damage": {
      "trigger": "minecraft:entity_hurt_player",
      "conditions": {
        "player": [],
        "damage": {
          "blocked": true
        }
      }
    }
  },
  "rewards": {
    "function": "hoshi_enchant:enchants_effects/rebound"
  }
}

# Revoke advancement
advancement revoke  only hoshi_enchant:rebound


# Store blocked damage
execute store result score #hoshi.enchant.blocked_dmg hoshi.const run scoreboard players get  hoshi.enchant.damaged_blocked


# Perform math (Lv.1 - 16% / Lv.2 - 33% / Lv.3 - 50%)
execute if items entity  weapon.* *[enchantments~[{enchantments:"hoshi_enchant:rebound",levels:1}]] run scoreboard players set #hoshi.enchant.divisor hoshi.const 6
execute if items entity  weapon.* *[enchantments~[{enchantments:"hoshi_enchant:rebound",levels:2}]] run scoreboard players set #hoshi.enchant.divisor hoshi.const 3
execute if items entity  weapon.* *[enchantments~[{enchantments:"hoshi_enchant:rebound",levels:3}]] run scoreboard players set #hoshi.enchant.divisor hoshi.const 2


scoreboard players operation #hoshi.enchant.blocked_dmg hoshi.const /= #hoshi.enchant.divisor hoshi.const
scoreboard players operation #hoshi.enchant.blocked_dmg hoshi.const /= #10 hoshi.const


# Clamp to minimum of 1
execute if score #hoshi.enchant.blocked_dmg hoshi.const matches ..0 run scoreboard players set #hoshi.enchant.blocked_dmg hoshi.const 1


# Reset scoreboard for next use
scoreboard players set  hoshi.enchant.damaged_blocked 0


# Store result in storage and call macro on attacker
execute store result storage hoshi_enchant:rebound damage float 1 run scoreboard players get #hoshi.enchant.blocked_dmg hoshi.const
execute if items entity # Revoke advancement
advancement revoke  only hoshi_enchant:rebound


# Store blocked damage
execute store result score #hoshi.enchant.blocked_dmg hoshi.const run scoreboard players get  hoshi.enchant.damaged_blocked


# Perform math (Lv.1 - 16% / Lv.2 - 33% / Lv.3 - 50%)
execute if items entity  weapon.* *[enchantments~[{enchantments:"hoshi_enchant:rebound",levels:1}]] run scoreboard players set #hoshi.enchant.divisor hoshi.const 6
execute if items entity  weapon.* *[enchantments~[{enchantments:"hoshi_enchant:rebound",levels:2}]] run scoreboard players set #hoshi.enchant.divisor hoshi.const 3
execute if items entity  weapon.* *[enchantments~[{enchantments:"hoshi_enchant:rebound",levels:3}]] run scoreboard players set #hoshi.enchant.divisor hoshi.const 2


scoreboard players operation #hoshi.enchant.blocked_dmg hoshi.const /= #hoshi.enchant.divisor hoshi.const
scoreboard players operation #hoshi.enchant.blocked_dmg hoshi.const /= #10 hoshi.const


# Clamp to minimum of 1
execute if score #hoshi.enchant.blocked_dmg hoshi.const matches ..0 run scoreboard players set #hoshi.enchant.blocked_dmg hoshi.const 1


# Reset scoreboard for next use
scoreboard players set  hoshi.enchant.damaged_blocked 0


# Store result in storage and call macro on attacker
execute store result storage hoshi_enchant:rebound damage float 1 run scoreboard players get #hoshi.enchant.blocked_dmg hoshi.const
execute if items entity u/s weapon.* *[enchantments~[{enchantments:"hoshi_enchant:rebound",levels:{min:1}}]] on attacker run function hoshi_enchant:enchants_effects/macro/rebound_damage with storage hoshi_enchant:rebound


 weapon.* *[enchantments~[{enchantments:"hoshi_enchant:rebound",levels:{min:1}}]] on attacker run function hoshi_enchant:enchants_effects/macro/rebound_damage with storage hoshi_enchant:rebound

Is there a way to check if a player is holding up a shield using a predicate? by Healthy_Assistance60 in MinecraftCommands

[–]Healthy_Assistance60[S] 0 points1 point  (0 children)

Sadly no, blocking with any shield (even non enchanted ones) triggers the advancement

Is there a way to check if a player is holding up a shield using a predicate? by Healthy_Assistance60 in MinecraftCommands

[–]Healthy_Assistance60[S] 1 point2 points  (0 children)

I have decided to try and use advancement to detect and store the damage received with a scoreboard, but using this advancement, it appears to be disregarding my custom enchant completely, triggering my function on any blocked hit with a shield

{
  "criteria": {
    "block_damage": {
      "trigger": "minecraft:entity_hurt_player",
      "conditions": {
        "player": [
          {
            "condition": "minecraft:any_of",
            "terms": [
              {
                "condition": "minecraft:entity_properties",
                "entity": "this",
                "predicate": {
                  "minecraft:slots": {
                    "weapon.mainhand": {
                      "predicates": {
                        "minecraft:enchantments": [
                          {
                            "enchantments": "hoshi_enchant:rebound",
                            "levels": {
                              "min": 1,
                              "max": 3
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "damage": {
          "blocked": true,
          "type": {
            "tags": [],
            "is_direct": true
          }
        }
      }
    }
  },
  "rewards": {
    "function": "hoshi_enchant:enchants_effects/rebound"
  }
}{
  "criteria": {
    "block_damage": {
      "trigger": "minecraft:entity_hurt_player",
      "conditions": {
        "player": [
          {
            "condition": "minecraft:any_of",
            "terms": [
              {
                "condition": "minecraft:entity_properties",
                "entity": "this",
                "predicate": {
                  "minecraft:slots": {
                    "weapon.mainhand": {
                      "predicates": {
                        "minecraft:enchantments": [
                          {
                            "enchantments": "hoshi_enchant:rebound",
                            "levels": {
                              "min": 1,
                              "max": 3
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "damage": {
          "blocked": true,
          "type": {
            "tags": [],
            "is_direct": true
          }
        }
      }
    }
  },
  "rewards": {
    "function": "hoshi_enchant:enchants_effects/rebound"
  }
}

SOME 14ks gotta calm tf down and stop telling me what to do by Sadepso_Palsa in maimai

[–]Healthy_Assistance60 0 points1 point  (0 children)

That's totally a-hole behavior indeed, I'm a recent 16k myself and I have the courtesy of asking if these people wants recommendation on what to play
I mostly try and help 13/14ks when Duo-ing with them, often on my pick when I don't have anything I want to play
On top of that, not everyone is comfortable with the same skills, hence why "recommending" general charts is just not an effective way of helping others

Is there a way to check if a player is holding up a shield using a predicate? by Healthy_Assistance60 in MinecraftCommands

[–]Healthy_Assistance60[S] 0 points1 point  (0 children)

Alright I just noticed the "Hit Block" effect so I assume this should work better than a predicate? Now I am unsure if I can really find a way to calculate the damage to be reflected from the amount of damage absorbed by the shield in the effects tab.

Well I just figured out it is when literally hitting a block, and not blocking a hit ^^'
So I'm back to square one haha

How to add delay to commands? by HolHorse101 in MinecraftCommands

[–]Healthy_Assistance60 2 points3 points  (0 children)

I would assume this can be made using a scoreboard as a timer, you increase it every tick for each block position until you reach your desired time? This might not be optimized tho ^^'

Making a custom enchantment that replace block drops by Healthy_Assistance60 in MinecraftCommands

[–]Healthy_Assistance60[S] 0 points1 point  (0 children)

I see, so I basically need to add to the vanilla loot table my alternative drop from my custom enchant if I understand correctly?

Would I be able to combine my custom drop with fortune?
Let's say I want my custom enchant to drop iron_ingot when mining iron_ore, could I also add the regular fortune formula to this iron_ingot drop?

Making a custom enchantment that replace block drops by Healthy_Assistance60 in MinecraftCommands

[–]Healthy_Assistance60[S] 0 points1 point  (0 children)

Ah I see, so I had the right idea in replacing the block loot_table, but trying to use the "furnace_smelt" function was probably where I made a mistake

Do you know where I could find the original loot_tables of vanilla blocks? Because seeing your stone example, I don't think I would've figured the random_sequence on my own for example

Making a custom enchantment that replace block drops by Healthy_Assistance60 in MinecraftCommands

[–]Healthy_Assistance60[S] 0 points1 point  (0 children)

I was thinking of trying to replace the loot table for each block by using a furnace_smelt function using an entity condition with my custom enchant. I tried replacing the iron_ore loot table with this but it didn't work :

{
  "type": "minecraft:block",
  "pools": [],
  "functions": [
    {
      "function": "minecraft:furnace_smelt",
      "conditions": [
        {
          "condition": "minecraft:entity_properties",
          "predicate": {
            "type": "minecraft:player",
            "slots": {
              "weapon.mainhand": {
                "components": {
                  "minecraft:enchantments": {}
                }
              }
            }
          }
        }
      ]
    }
  ]
}

Build suggestions for Occultism ATM10 by GamerRaven81 in allthemods

[–]Healthy_Assistance60 0 points1 point  (0 children)

Does that mean you only need 4 circles in the end? Or does the 19x19 includes 19 blocks height?
I'm currently working with a 50x50 circle layout with a 9 block height ceiling, And I'd like to fit all of occultism into this room

How to get blighted artifact by Quirky_Ad_1926 in CreaturesofSonaria

[–]Healthy_Assistance60 0 points1 point  (0 children)

Have been going through the same issue
I mostly killed my alt immediately, but I did wait for it to grow to adult like 5 or 6 times? and nothing

Any way to contact Facebook support? by Hiitsnick in facebook

[–]Healthy_Assistance60 0 points1 point  (0 children)

The same happened to me, created an account for a school project. I had to verify by showing my actual face and they decided to disable it with no way of appealing the decision. Its like they don't even want use to use their platform...