Here are my predicate overrides, inside of weather_cycle_device.json:
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "rafaels-weather-cycle-device:item/weather_cycle_device"
},
"overrides": [
{
"predicate": {
"rafaels-weather-cycle-device:weather_state": 2.0
},
"model": "rafaels-weather-cycle-device:item/weather_cycle_device_rainy"
},
{
"predicate": {
"rafaels-weather-cycle-device:weather_state": 3.0
},
"model": "rafaels-weather-cycle-device:item/weather_cycle_device_thunder"
}
]
}
Here is how I am setting the model states for items in the Java code:
package net.rafael.weathercycledevice.util;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.util.Identifier;
import net.rafael.weathercycledevice.RafaelsWeatherCycleDevice;
import net.rafael.weathercycledevice.components.ModComponentDataTypes;
import net.rafael.weathercycledevice.item.ModItems;
public class ModModelPredicates {
public static void registerModelPredicates() {
ModelPredicateProviderRegistry.register(ModItems.WEATHER_CYCLE_DEVICE, Identifier.of(RafaelsWeatherCycleDevice.MOD_ID, "weather_state"),
(stack, world, entity, seed) -> {
Integer weatherState = stack.get(ModComponentDataTypes.WeatherState);
return weatherState != null ? weatherState : 1;
});
}
}
In the beginning, my logs reported that the state was 1, and it changes after using the item appropriately to state 3. So, predicate values are changing but not the textures.
How can I affect the predicate overrides accordingly?
weather_cycle_device.json, can you first try removingrafaels-weather-cycle-device:fromlayer0and the twomodeloverrides? If that doesn't work, also try removingminecraft:fromparent. I initially did the same thing but for my old plugin, I ended up just using values like"item/generated"or"item/custom_item". Let me know how it goes and if it doesn't fix the problem, I'll see if I can't find some other issue.