Jump to content

[1.15.2] Forge BlockStates aren't working.


Legenes

Recommended Posts

Hi everyone!

I have a slight issue with the forge BlockStates currently, I set the variants as I should, but it cannot use them.

 

My BlockState JSON:

Quote

 


{
  "forge_marker": 1,
  "defaults": {
    "textures": {
      "texture" : "encherbs:blocks/plant_base",
      "particle": "encherbs:blocks/plant_base",
      "leaf"    : "encherbs:blocks/leaf_01"
    },
    "uvlock": true
  },
  "variants": {
    "facing": {
      "north": { "y": 0   },
      "east" : { "y": 90  },
      "south": { "y": 180 },
      "west" : { "y": 270 }
    },
    "growth_state": {
      "stage0":   { "model": "encherbs:block/test_plant_stage0"   },
      "stage1":   { "model": "encherbs:block/test_plant_stage1"   },
      "stage2":   { "model": "encherbs:block/test_plant_stage2"   },
      "stage3":   { "model": "encherbs:block/test_plant_stage3"   },
      "produce0": { "model": "encherbs:block/test_plant_produce0" },
      "produce1": { "model": "encherbs:block/test_plant_produce1" },
      "produce2": { "model": "encherbs:block/test_plant_produce2" }
    }
  }
}

 

 

Error messages:

Quote

[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=east,growth_state=stage0'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=east,growth_state=stage1'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=east,growth_state=stage2'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=east,growth_state=stage3'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=west,growth_state=produce0'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=west,growth_state=produce1'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=west,growth_state=produce3'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=north,growth_state=stage0'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=north,growth_state=stage1'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=north,growth_state=stage2'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=north,growth_state=stage3'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=south,growth_state=stage2'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=east,growth_state=produce3'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=south,growth_state=stage3'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=south,growth_state=stage0'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=south,growth_state=stage1'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=east,growth_state=produce1'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=east,growth_state=produce0'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=south,growth_state=produce3'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=south,growth_state=produce0'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=south,growth_state=produce1'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=north,growth_state=produce0'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=north,growth_state=produce1'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=north,growth_state=produce3'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=west,growth_state=stage0'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=west,growth_state=stage1'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=west,growth_state=stage2'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' missing model for variant: 'encherbs:test_plant#facing=west,growth_state=stage3'
[15:18:22] [Server-Worker-25/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'encherbs:blockstates/test_plant.json' in resourcepack: 'Mod Resources': Missing model, expected to find a string

 

 

I'm clueless. If someone can help me that would be really appreciated. Thanks!

 

procedure WakeMeUp(Integer plusTime);
var
  I: Integer;
begin
  for I := 0 to plusTime do begin
    println('One more minute!');
    Sleep(1000);
  end;
  println('Okay, nothing to worry, I''m alive!');
  println('So... somebody can give me a coffee?');
  println('I know it''s Pascal, and not Java, but I love it :D.');
end;
Link to comment
Share on other sites

Can you provide me with an example, please? The forgedocs still has forge blockstates in it for 1.15.x .

procedure WakeMeUp(Integer plusTime);
var
  I: Integer;
begin
  for I := 0 to plusTime do begin
    println('One more minute!');
    Sleep(1000);
  end;
  println('Okay, nothing to worry, I''m alive!');
  println('So... somebody can give me a coffee?');
  println('I know it''s Pascal, and not Java, but I love it :D.');
end;
Link to comment
Share on other sites

The best I can do is say check vanilla blockstates for something similar to what you want to do. That's what I do when I'm messing with stuff is just check vanilla for resources, or search the forums/google.

 

I haven't got any examples unfortunately!

 

*edit: actually, I do have a crop I made when I was messing around:

blockstate:

Quote

{
    "variants": {
        "age=0": { "model": "bunchostuff:block/fireflower_stage_0" },
        "age=1": { "model": "bunchostuff:block/fireflower_stage_1" },
        "age=2": { "model": "bunchostuff:block/fireflower_stage_2" },
        "age=3": { "model": "bunchostuff:block/fireflower_stage_3" }
    }
}

model (they all pretty much look like this, just different texture):

Quote

{
    "parent": "minecraft:block/cross",
    "textures": {
        "cross": "bunchostuff:block/fireflower_stage_0"
    }
}

 

Edited by Ugdhar
Link to comment
Share on other sites

38 minutes ago, Ugdhar said:

The best I can do is say check vanilla blockstates for something similar to what you want to do. That's what I do when I'm messing with stuff is just check vanilla for resources, or search the forums/google.

 

I haven't got any examples unfortunately!

 

*edit: actually, I do have a crop I made when I was messing around:

blockstate:

model (they all pretty much look like this, just different texture):

 

I didn't want to use vanilla blockstates for a reason, by default if I have one blockstate for my block, it's okay to use it, but when I have two (in my case facing and growth) that means that I have to declare everything [facing] X [growth] times which is 28. I didn't wanted to declare 28 states, but I guess I'm gonna have to, unless there's a documentation for the custom loader with an example. (Again, forgedocs says something about the custom loader, but no example or the use of this new "loader" tag) Thanks anyway.

procedure WakeMeUp(Integer plusTime);
var
  I: Integer;
begin
  for I := 0 to plusTime do begin
    println('One more minute!');
    Sleep(1000);
  end;
  println('Okay, nothing to worry, I''m alive!');
  println('So... somebody can give me a coffee?');
  println('I know it''s Pascal, and not Java, but I love it :D.');
end;
Link to comment
Share on other sites

18 minutes ago, Alpvax said:

Look at https://minecraft.gamepedia.com/Model#Block_states. Specifically the "multipart: Used instead of variants to combine models based on block state attributes" part.

It allows you to declare individual states and models for each. Fences show how it is used.

This is just what I need, thank you. However, I'm still getting the same errors from this multipart blockstate:
 

Quote

{
  "multipart": [
    { "when": { "stage" : "stage0" },
      "apply": { "model": "encherbs:block/test_plant_stage0" } },
    { "when": { "stage" : "stage1" },
      "apply": { "model": "encherbs:block/test_plant_stage1" } },
    { "when": { "stage" : "stage2" },
      "apply": { "model": "encherbs:block/test_plant_stage2" } },
    { "when": { "stage" : "stage3" },
      "apply": { "model": "encherbs:block/test_plant_stage3" } },

    { "when": { "stage" : "produce0" },
      "apply": { "model": "encherbs:block/test_plant_produce0" } },
    { "when": { "stage" : "produce1" },
      "apply": { "model": "encherbs:block/test_plant_produce1" } },
    { "when": { "stage" : "produce2" },
      "apply": { "model": "encherbs:block/test_plant_produce2" } },

    { "when": { "facing": "north" },
      "apply": { "y": 0   } },
    { "when": { "facing": "east"  },
      "apply": { "y": 90  } },
    { "when": { "facing": "south" },
      "apply": { "y": 180 } },
    { "when": { "facing": "west"  },
      "apply": { "y": 270 } }
  ]
}

 

 

procedure WakeMeUp(Integer plusTime);
var
  I: Integer;
begin
  for I := 0 to plusTime do begin
    println('One more minute!');
    Sleep(1000);
  end;
  println('Okay, nothing to worry, I''m alive!');
  println('So... somebody can give me a coffee?');
  println('I know it''s Pascal, and not Java, but I love it :D.');
end;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I am getting an error message that my mods and my server are not on the same minecraft version when they clearly are. My server and my mods are on 1.20.1 and the error says that the server is 1.20 even though it's on forge 47.2.30.  
    • .Omg, I'm so freaking blind I didn't notice that, it works now, thank you so much @Xoroshio
    • On the one off the last lines of code you have put && boots.isEmpty() Instead of && !boots.isEmpty() is that a typo?
    • I'm trying to apply effects to the emerald armor but it doesn't work, I read that the onArmorTick() method doesn't work anymore, but I tried with inventoryTick, onInventoryTick and onArmorTick but they don't apply the effect either, I don't know if I'm writing it wrong, so I need help to fix it. This is the code in question: public class ModArmorItem extends ArmorItem{ private static final Map<ArmorMaterial, MobEffectInstance> MATERIAL_TO_EFFECT_MAP = (new ImmutableMap.Builder<ArmorMaterial, MobEffectInstance>()) .put(ModArmorMaterials.EMERALD, new MobEffectInstance( MobEffects.HERO_OF_THE_VILLAGE, 200, 1, false, false, true)) .build(); public ModArmorItem(ArmorMaterial pMaterial, Type pType, Properties pProperties) { super(pMaterial, pType, pProperties); } @Override public void onArmorTick(ItemStack stack, Level world, Player player){ if (!world.isClientSide()) { if (hasFullSuitOfArmorOn(player)) { evaluateArmorEffects(player); } } } private void evaluateArmorEffects(Player player) { for (Map.Entry<ArmorMaterial,MobEffectInstance> entry : MATERIAL_TO_EFFECT_MAP.entrySet()){ ArmorMaterial mapArmorMaterial = entry.getKey(); MobEffectInstance mapStatusEffect = entry.getValue(); if (hasCorrectArmorOn(mapArmorMaterial, player)) { addStatusEffectForMaterial(player, mapArmorMaterial, mapStatusEffect); } } } private void addStatusEffectForMaterial(Player player, ArmorMaterial mapArmorMaterial, MobEffectInstance mapStatusEffect) { boolean hasPlayerEffect = player.hasEffect(mapStatusEffect.getEffect()); if (hasCorrectArmorOn(mapArmorMaterial, player) && !hasPlayerEffect) { player.addEffect(new MobEffectInstance(mapStatusEffect)); } } private boolean hasCorrectArmorOn(ArmorMaterial material, Player player) { for (ItemStack armorStack : player.getInventory().armor){ if (!(armorStack.getItem() instanceof ArmorItem)) { return false; } } ArmorItem helmet = ((ArmorItem)player.getInventory().getArmor(3).getItem()); ArmorItem brestplace = ((ArmorItem)player.getInventory().getArmor(2).getItem()); ArmorItem leggins = ((ArmorItem)player.getInventory().getArmor(1).getItem()); ArmorItem boots = ((ArmorItem)player.getInventory().getArmor(0).getItem()); return helmet.getMaterial() == material && brestplace.getMaterial() == material && leggins.getMaterial() == material && boots.getMaterial() == material; } private boolean hasFullSuitOfArmorOn(Player player){ ItemStack helmet = player.getInventory().getArmor(3); ItemStack breastplace = player.getInventory().getArmor(2); ItemStack leggins = player.getInventory().getArmor(1); ItemStack boots = player.getInventory().getArmor(0); return !helmet.isEmpty() && !breastplace.isEmpty() && !leggins.isEmpty() && boots.isEmpty(); } } And here is the armor   public static final RegistryObject<Item> EMERALD_HELMET = ITEMS.register( "emerald_helmet", () -> new ModArmorItem(ModArmorMaterials.EMERALD, ArmorItem.Type.HELMET, new Item.Properties()) ); public static final RegistryObject<Item> EMERALD_CHESTPLATE = ITEMS.register( "emerald_chestplate", () -> new ModArmorItem(ModArmorMaterials.EMERALD, ArmorItem.Type.CHESTPLATE, new Item.Properties()) ); public static final RegistryObject<Item> EMERALD_LEGGINS = ITEMS.register( "emerald_leggins", () -> new ModArmorItem(ModArmorMaterials.EMERALD, ArmorItem.Type.LEGGINGS, new Item.Properties()) ); public static final RegistryObject<Item> EMERALD_BOOTS = ITEMS.register( "emerald_boots", () -> new ModArmorItem(ModArmorMaterials.EMERALD, ArmorItem.Type.BOOTS, new Item.Properties()) ); I hope you can help me. Thanks.
    • so ive been having this issue for a little bit, and have honestly no clue on how to fix it. I'm using minecraft 1.20.1 for clarification.  Here is the latest log: https://pastebin.com/neMuxELv
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.