#Issues with "ban".

1 messages · Page 1 of 1 (latest)

fierce terrace
#

Hi, I made a similar post before, yet here we are again.

As part of an auto-ban script I run execute as @a[scores={BanTool=1..}] at @s run ban @p You have died. every tick.
This causes some issues, apparently.

  1. It seems to break a deathsound i want to play every time someone dies
{
  "deathcannon": {
    "sounds": [
      {
        "name": "death_cannon:deathcannon",
        "stream": true
      }
    ]
  }
}

scoreboard objectives add DeathCannon deathCount (Load)
execute as @a[scores={DeathCannon=1..}] at @s run playsound deathcannon.deathcannon master @a ~ ~ ~ (Tick)
scoreboard players set @a[scores={DeathCannon=1..}] DeathCannon 0 (Tick)
2. It also seems to break an override for the evoker loot table, which seeks to replace totems of undying with golden apples for their loot table.

{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:golden_apple",
          "conditions": [
            {
              "condition": "minecraft:killed_by_player",
              "inverse": false
            }
          ]
        }
      ]
    },
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:emerald",
          "conditions": [
            {
              "condition": "minecraft:killed_by_player",
              "inverse": false
            }
          ],
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 2,
                "max": 3
              }
            }
          ]
        }
      ]
    }
  ],
  "functions": []
}

Other aspects of the datapack, including

  1. Custom advancements which grant items and recipes
  2. Custom recipes themselves
  3. Overrides to vanilla enchantments
  4. Some other stuff
    Work just fine.
    It's just the two abovementioned.

That said, if I change
execute as @a[scores={BanTool=1..}] at @s run ban @p You have died.
To execute as @a[scores={BanTool=1..}] at @s run tellraw @a "You have died."
Both the evoker loot table and the death sound work as intended. IN SINGLEPLAYER ONLY.
On the server, only the deathsound gets fixed. The evoker loot table remains vanille (broken, for my implementation)

This does make me believe that using ban itself is the issue?
Which is VERY unfortunate, as it somewhat breaks apart the core concept of what I am trying to do.

If anyone has an inkling on whether it could be some other thing that could be breaking things, or an alternative implementation to the ban functionality, please let me know.

paper helm
#

Are you noticing this breakage in singleplayer?

fierce terrace
#

Oh, important to know may be that I originally made this in 1.21.5.
I am now using this in latest, 1.21.11
I am running this on a fabric server.

Perhaps there were changes between those versions that could break things?
But it's weird because the behaviour is wildly inconsistent since removing "ban" from execute as @a[scores={BanTool=1..}] at @s run ban @p You have died. causes it to fully work in singleplayer, while that doesn't occur on the server

#

not vanilla, singleplayer dsgafdgd

#

On the server the evoker loot table just doesn't seem to work

paper helm
#

There is nothing wrong with that command, at least not that would break it or anything else

#

I'm confused, you're saying this does work in singleplayer? Because that shouldn't be possible

fierce terrace
#

Well it does break singleplayer because "ban" isnt a valid argument

paper helm
#

Ah, yes exactly

fierce terrace
#

That said, if I change
execute as @a[scores={BanTool=1..}] at @s run ban @p You have died.
To execute as @a[scores={BanTool=1..}] at @s run tellraw @a "You have died."
Both the evoker loot table and the death sound work as intended. IN SINGLEPLAYER ONLY.
On the server, only the deathsound gets fixed. The evoker loot table remains vanille (broken, for my implementation)

#

Its so weird

paper helm
#

The evoker loot table is completely unrelated

#

You just need to remove the empty functions list in that

fierce terrace
#

oh god

#

where is that

#

at the bottom

#

right.

paper helm
#

Mhm

fierce terrace
#

i am ending it all

#

I am still curious what breaks the death sound

paper helm
#

Please relax

#

Can you elaborate on the sound issue?

#

In what way doesn't it work?

fierce terrace
paper helm
#

Are you still able to play the sound yourself from chat?

fierce terrace
# paper helm Mhm

the funny thing is that even with that empty list it works in singleplayer lol

fierce terrace
#

let me restart the server just to make sure

#

Just /reload doesn't seem to have fixed the issue with the loot table (when removing the empty list)

fierce terrace
#

Yes I can play the sound

#

Oh, the sound is playing I am just bad at this.

The issue is that it is played locally where the player died.
The intention is that it is played globally (at the location of every online player) when triggered

#

as for the loot table, that just doesn't seem like it wants to work.
I do have an idea though.

#

Could it be, that a datapack from vanillatweaks that adds droppable mob heads overwrites.. my overwrite?

#

This one

#

I'll put that on singleplayer to confirm

#

That is exactly it

#

And removing it fixes the issue.

#

That leaves the deathsound

#

execute as @a[scores={DeathCannon=1..}] at @s run playsound deathcannon.deathcannon master @a ~ ~ ~

#

Whcih the issue should be here

#

@s run playsound should probably be @a ?

#

Indeed

#

Alright

#

Hopefully

#

Solved