Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom head as armor can't be locked #973

Closed
lefckntea opened this issue Mar 19, 2022 · 6 comments
Closed

Custom head as armor can't be locked #973

lefckntea opened this issue Mar 19, 2022 · 6 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@lefckntea
Copy link

If you put a custom head on your helmet armor slot you can't lock it so the player will always be able to take it off which made me cry yesterday
make it so i can put locked="true" within

mame can vouch

@Pablete1234 Pablete1234 added the bug Something isn't working label Mar 19, 2022
@Pablete1234
Copy link
Member

It would be helpful if you provide a MRE for whoever wants to test and fix the issue, otherwise you're making whoever wants to debug the issue have to create or search for a map to test this on

@lefckntea
Copy link
Author

lefckntea commented Mar 19, 2022

I made a map "Badlands Champions" it should be loaded on mapdev. It utilizes classes and i put a custom head on each of them.
I tried putting locked="true" into it did nothing and mame also tried some other ways how to fix it but didnt succeed
( i think he tried putting inside of but that didnt work)

@calcastor
Copy link
Contributor

this is an example of usage of <head/> with which locking is not possible

    <class name="Ranger" description="Shoot Arrows" icon="bow">
        <kit parents="spawn-protection">
            <item slot="0" unbreakable="true">stone sword</item>
            <item slot="1" unbreakable="true">bow</item>
            <item slot="3" amount="1">golden apple</item>
            <item slot="8" amount="28">arrow</item>
            <head slot="slot.armor.head" locked="true" name="Ranger" uuid="4d80305f-70c7-403a-9e31-f55179acdbbf">
                <skin>ewogICJ0aW1lc3RhbXAiIDogMTY0NzU1MDAxNDM0NSwKICAicHJvZmlsZUlkIiA6ICI0ZDgwMzA1ZjcwYzc0MDNhOWUzMWY1NTE3OWFjZGJiZiIsCiAgInByb2ZpbGVOYW1lIiA6ICJDb2R5NTc5IiwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2NlOWM1YjIyZDI5OWNhYjhlNTAyODM0MzRiZTYxOTBiN2MzZGI3MDc1Yzk0ZTk4NWU2MDQzNzNjODBlNjZiNzMiLAogICAgICAibWV0YWRhdGEiIDogewogICAgICAgICJtb2RlbCIgOiAic2xpbSIKICAgICAgfQogICAgfQogIH0KfQ==</skin>
            </head>
            <chestplate unbreakable="true">iron chestplate</chestplate>
            <leggings unbreakable="true" material="iron leggings">
                <enchantment level="3">projectile_protection</enchantment>
            </leggings>
            <boots unbreakable="true">iron boots</boots>
        </kit>
    </class>

@calcastor
Copy link
Contributor

calcastor commented Mar 19, 2022

I tested to see if this was somehow related to defining a class within a kit and it doesn't seem to be. Interestingly, the head item seems as though it's locked but can be removed if you click a couple more times. Edit: given #977 I think this was a fluke

Here's a download of an OCC community map submission which I've edited the XML to try to lock head items added to a kit as armour.

@Pablete1234 Pablete1234 added the good first issue Good for newcomers label Mar 20, 2022
@Pugzy
Copy link
Contributor

Pugzy commented Mar 18, 2023

Resolved in #1146?

@Pablete1234
Copy link
Member

Pablete1234 commented Mar 19, 2023

Even if it's a bit of a weird fix, it is a fix.
The issue resides in armor being handled differently to items in pgm, and when you need head (or book etc) metadata you can't really put it as part of the ArmorKit (one of helmet, chestplate, etc) and instead have to use them as item, but with slot being head. Since locked is now supported for those items too, the difference i believe is purely technical and can likely be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Development

No branches or pull requests

4 participants