PatchWolf's Avatar
Member
Level 32 Artisan Button Pusher
32

Forum Posts

1 - 7 of 7

    PatchWolf
    07/04/2021 7:39 pm
    Level 32 : Artisan Button Pusher
    history
    PatchWolf's Avatar
    So my current solution is mildly ugly and horrendous but at least it works most of the time.
    I've been working with predicates more and realized that I could use the "Alternative" predicate as an "or" statement between other predicates and stitched together a Frankenstein of location checks so that when a skeleton/zombie/spider first spawns it checks the blocks around it to see if there is a spawner. Sometimes this fails (probably cuz it does almost 150 location checks) but it's the best "working" solution I have so far. I'll probably still keep looking though because I don't know how bad this could affect world/server performance.


    (the code seems to get compressed weird when I paste it in here but it's mostly just to show how horrible this solution seems to me)
    The Monster predicate checks :/ (this is 1/3 of it)
    [ { "condition": "minecraft:alternative", "terms": [ { "condition": "minecraft:location_check", "offsetX": 3, "offsetY": 0, "offsetZ": 3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 2, "offsetY": 0, "offsetZ": 3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 1, "offsetY": 0, "offsetZ": 3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 0, "offsetY": 0, "offsetZ": 3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -1, "offsetY": 0, "offsetZ": 3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -2, "offsetY": 0, "offsetZ": 3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -3, "offsetY": 0, "offsetZ": 3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 3, "offsetY": 0, "offsetZ": 2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 2, "offsetY": 0, "offsetZ": 2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 1, "offsetY": 0, "offsetZ": 2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 0, "offsetY": 0, "offsetZ": 2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -1, "offsetY": 0, "offsetZ": 2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -2, "offsetY": 0, "offsetZ": 2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -3, "offsetY": 0, "offsetZ": 2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 3, "offsetY": 0, "offsetZ": 1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 2, "offsetY": 0, "offsetZ": 1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 1, "offsetY": 0, "offsetZ": 1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 0, "offsetY": 0, "offsetZ": 1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -1, "offsetY": 0, "offsetZ": 1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -2, "offsetY": 0, "offsetZ": 1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -3, "offsetY": 0, "offsetZ": 1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 3, "offsetY": 0, "offsetZ": 0, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 2, "offsetY": 0, "offsetZ": 0, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 1, "offsetY": 0, "offsetZ": 0, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 0, "offsetY": 0, "offsetZ": 0, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -1, "offsetY": 0, "offsetZ": 0, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -2, "offsetY": 0, "offsetZ": 0, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -3, "offsetY": 0, "offsetZ": 0, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 3, "offsetY": 0, "offsetZ": -1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 2, "offsetY": 0, "offsetZ": -1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 1, "offsetY": 0, "offsetZ": -1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 0, "offsetY": 0, "offsetZ": -1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -1, "offsetY": 0, "offsetZ": -1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -2, "offsetY": 0, "offsetZ": -1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -3, "offsetY": 0, "offsetZ": -1, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 3, "offsetY": 0, "offsetZ": -2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 2, "offsetY": 0, "offsetZ": -2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 1, "offsetY": 0, "offsetZ": -2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 0, "offsetY": 0, "offsetZ": -2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -1, "offsetY": 0, "offsetZ": -2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -2, "offsetY": 0, "offsetZ": -2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -3, "offsetY": 0, "offsetZ": -2, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } },
    { "condition": "minecraft:location_check", "offsetX": 3, "offsetY": 0, "offsetZ": -3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 2, "offsetY": 0, "offsetZ": -3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 1, "offsetY": 0, "offsetZ": -3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": 0, "offsetY": 0, "offsetZ": -3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -1, "offsetY": 0, "offsetZ": -3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -2, "offsetY": 0, "offsetZ": -3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } }, { "condition": "minecraft:location_check", "offsetX": -3, "offsetY": 0, "offsetZ": -3, "predicate": { "block": { "blocks": [ "minecraft:spawner" ] } } } ] } ]
    2
    PatchWolf
    07/04/2021 7:12 am
    Level 32 : Artisan Button Pusher
    PatchWolf's Avatar
    I appreciate the idea but at the same time the root of my problem as far as I can tell is detecting where a a certain block- in this case a mob spawner is. So far in my pack the spawners are not truly disabled- I don't know a way to truly disable mob spawning I just counteract it by using scoreboards and sending unwanted mobs to the void. That being said if a mob exists for more than two ticks or accumulates a score of 2 or more they don't get void yeeted.

    Anyways, the fact that the spawners are not truly disabled gave me a window of hope that maybe I could do something in the one tick that the mobs get to exist before they get sent to the recycle bin.

    and while spawndata only sets one spawn, I could maybe do something with spawn potential as HoboMaggot pointed out, but in looking at spawn potential modification I didn't see an easy way to give them custom scores. I did notice that with spawners they can be assigned teams though so I might look into that.
    1
    PatchWolf
    07/04/2021 6:55 am
    Level 32 : Artisan Button Pusher
    PatchWolf's Avatar
    Answer: Once they spawn they can walk around freely.

    my problem currently is detecting where in the world mob spawners are. Without that summoning mobs with commands seems a bit off.
    1
    PatchWolf
    07/04/2021 6:51 am
    Level 32 : Artisan Button Pusher
    PatchWolf's Avatar
    I tp them into the void, but if they spawn outside the area and exist longer than two ticks they get a score higher than the minimum that lets them wander into the area. my thinking for a workaround would be to add to their scores even more if they spawned near a mob spawner- that way they wouldn't get void yeeted.
    1
    PatchWolf
    07/03/2021 4:48 am
    Level 32 : Artisan Button Pusher
    PatchWolf's Avatar
    hmmm... maybe... I hadn't thought of that but what I need has to be preformed in one tick so that it can prevent the mobs from being removed in time. If I understand right recasting isn't instant and would take a lot of set up and multiple ticks.
    1
    PatchWolf
    06/25/2021 3:18 pm
    Level 32 : Artisan Button Pusher
    history
    PatchWolf's Avatar
    The json program I was using was formatting stuff wrong, so while it looked good it actually needed to be a little different:

    The working code:

    "criteria": {
      "requirement": {
        "trigger": "minecraft:inventory_changed",
         "conditions": {
           "items": [
            {
            "items": [
             "minecraft:oak_planks"
            ],
            "nbt": "{display:{Name:'{\"text\":\"A\"}'}}"
           }
          ]
        }
      }
    }
    1
    PatchWolf
    06/14/2021 6:54 pm
    Level 32 : Artisan Button Pusher
    PatchWolf's Avatar
    nevermind I figured it out
    1

1 - 7 of 7

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome