Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

Unable to set a setting with type `BlockEntityType`

Redhawk18 opened this issue ยท 3 comments

commented

Some information

Operating system:
Java version:
Minecraft version:
Baritone version: master 1.19
Other mods (if used):

Exception, error or logs

I added this setting

    /**
     * The block entity to scan the world for to collect items from.
     */
    public Setting<BlockEntityType> storageBox = new Setting<>(BlockEntityType.CHEST);

When I try to set it in game with for example
#settings storageBox BlockEntityType.SHULKER_BOX I got an uncaught exception.

commented

If you want to use new types for setting values and be able to set them via commands / settings file you also have to implement a parser + serializer pair for that type in SettingsUtil.
(Note: This is my last inbox check before disappearing for two weeks)

commented

If you want to use new types for setting values and be able to set them via commands / settings file you also have to implement a parser + serializer pair for that type in SettingsUtil. (Note: This is my last inbox check before disappearing for two weeks)

Is there a style guide for what is expect? Because minecraft has all of these types as constants but we could for example change SHULKER_BOX to minecraft:shulker_box

commented

No, there is no style guide. For #4452 I went for the enum names mainly for ease of parsing, but generally I think using the textual id is preferable from a usage point of view.