apace100 / apoli

MIT License
40 stars 46 forks source link

The `climbing` entity condition type is not working properly #174

Closed Reniel80 closed 1 year ago

Reniel80 commented 1 year ago

after hundreds of attempts.... The problem seems that climbing is not detected as condition (not only with phasing power) { "condition": { "type": "origins:climbing" }, "type": "origins:phasing", "block_condition": { "type": "origins:in_tag", "tag": "minecraft:leaves" }, "render_type": "none", "view_distance": 10 }

but then minecraft crashes if i add this new condition (only phasing when going up or down)

{ "condition": { "type": "origins:and", "conditions": [ { "type": "origins:climbing" }, { "type": "origins:or", "conditions": [ { "type": "origins:block_collision", "offset_y": 0.01 }, { "type": "origins:block_collision", "offset_y": -0.01 } ] } ] }, "type": "origins:phasing", "block_condition": { "type": "origins:in_tag", "tag": "minecraft:leaves" }, "render_type": "none", "view_distance": 10 }

crash report: https://github.com/Reniel80/Legendary-Origins/blob/Legendary-Origins/apoli%20issues/crash.txt

eggohito commented 1 year ago

I cannot reproduce this issue with this power I've used for testing:

{
    type: "apoli:climbing",
    condition: {
        type: "apoli:or",
        conditions: [
            {
                type: "apoli:block_collision",
                block_condition: {
                    type: "apoli:in_tag",
                    tag: "minecraft:dirt"
                },
                offset_x: 0.1,
                offset_z: 0.1
            },
            {
                type: "apoli:block_collision",
                block_condition: {
                    type: "apoli:in_tag",
                    tag: "minecraft:dirt"
                },
                offset_x: -0.1,
                offset_z: -0.1
            }
        ]
    }
}

I've also used Origins 1.11.3. Can you send what you've tried?

Reniel80 commented 1 year ago

i modified the original post with a detailed example of what i tried, .. this is another climbing issue linked to a resource: i have declared a resource as "energy" and if you climb, energy consumes, but this not working properly too.

{ "type": "origins:multiple", "energy": { "type": "origins:resource", "min": 0, "max": 100, "start_value": 100 }, "consume_energy": { "condition": { "type": "origins:climbing" }, "type": "origins:action_over_time", "interval": 20, "entity_action": { "type": "origins:modify_resource", "resource": "0:global_energy", "modifier": { "operation": "addition", "value": -1 } } } }

the problem was not the in_tag as i thought.. the real issue was climbing as condition and the phasing powewr crash.

eggohito commented 1 year ago

Can you send the data pack? Also, the issue in your original post doesn't seem related to the climbing issue you're mentioning, but more like with the block_collision entity condition type not working well with the phasing power type, so make sure to create a new issue for that

eggohito commented 1 year ago

i modified the original post with a detailed example of what i tried, .. this is another climbing issue linked to a resource: i have declared a resource as "energy" and if you climb, energy consumes, but this not working properly too. ...

I've also tested this power (with a few tweaks) in Origins 1.11.3, with normal climbing and climbing provided by a power that uses the climbing power type, and it seems to be working just fine, so I'll be needing the data pack to troubleshoot further. Here's the tweaked power if you're interested:

(I changed 0:global_energy to *:*_energy to reference the energy sub-power without the need of also referencing the power's ID. I also added the hud_render field in energy to see if its value is being changed, which seemed to be the case)

{
    "type": "origins:multiple",
    "energy": {
        "type": "origins:resource",
        "min": 0,
        "max": 100,
        "start_value": 100,
        "hud_render": {
            "should_render": true
        }
    },
    "consume_energy": {
        "condition": {
            "type": "origins:climbing"
        },
        "type": "origins:action_over_time",
        "interval": 10,
        "entity_action": {
            "type": "origins:modify_resource",
            "resource": "*:*_energy",
            "modifier": {
                "operation": "addition",
                "value": -1
            }
        }
    }
}
Reniel80 commented 1 year ago

Test Pack.zip

The first error you will find is the "Phasing" power when climbing a tree [file: elf/phasing_leaves] (must sneaking for climbing) To see the next issue must disable the Phasing power or crash won't let you.

"modify_resource with climbing as condition" [fie: global/energy] ... also if "holding" it doesn't work either.

• it works perfect when sprinting or swimming as condition but not when climbing or holding.

eggohito commented 1 year ago

This should now be fixed as of 38f95c899da4552c8904f930028887184bcc3445 by specifying the current field in the entity condition with a value of false. The issue in your original post should also be fixed as of 8d065b3fab283f2a1d4782b4509dec1686aa263e