Jump to content

[SOLVED] "model missing for variant" exception


Bauzli

Recommended Posts

As stated in the title, i get the "model missing for variant" exception for a log-like block i'm creating, although the referenced model is there. The block is correctly looking in inventory and hand, but has the purple-black texture when placed. I know that, usually, when that exception is thrown, there is a description of the error underneath, however, in shell, there isn't. I'm doing 1.14.3 and using Eclipse, so i have to use a Windows Batch file to start the game.

 

 

 Exception loading blockstate definition: 'testmod:blockstates/carved_oak_log.json' missing model for variant: 'testmod:carved_oak_log#'

 

Blockstate json:

{
    "variants": {
        "axis=y":    { "model": "testmod:block/carved_oak_log" },
        "axis=z":     { "model":"testmod:block/carved_oak_log", "x": 90 },
        "axis=x":     { "model": "testmod:block/carved_oak_log", "x": 90, "y": 90 }
    }
}

 

Model json:

{
    "parent": "block/cube_column",
    "textures": {
        "end": "block/oak_log_top",
        "side": "testmod:block/carved_oak_log"
    }
}

 

Texture (pretty sure irrelevant but it is attachments).

 

Registry:

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
	public static class RegistryEvents
	{
		
		//ITEMS ITEMS ITEMS//
		
		@SubscribeEvent
		public static void registerItems(final RegistryEvent.Register<Item> event)
		{
			event.getRegistry().registerAll
			(
					//NormalItems
					ItemList.tutorial_item = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("tutorial_item")),
					
					
					//Block Items
					ItemList.tutorial_block = new BlockItem(BlockList.tutorial_block, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(BlockList.tutorial_block.getRegistryName()),
					
					ItemList.carved_oak_log = new BlockItem(BlockList.carved_oak_log, new Item.Properties().group(ItemGroup.BUILDING_BLOCKS)).setRegistryName(BlockList.carved_oak_log.getRegistryName())
			);	
			
			logger.info("Items registered.");
		}	   
		
		//BLOCKS BLOCKS BLOCKS//
		
		@SubscribeEvent
		public static void registerBlocks(final RegistryEvent.Register<Block> event)
		{
			event.getRegistry().registerAll
		    (
		    	BlockList.tutorial_block = new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(3.0f, 2.0f).lightValue(7).sound(SoundType.METAL)).setRegistryName(location("tutorial_block")),
		    
		    	BlockList.carved_oak_log = new Block(Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0f, 2.0f).sound(SoundType.WOOD)).setRegistryName(location("carved_oak_log"))
			);
			
			logger.info("Blocks registered.");
		}

 

carved_oak_log.png

Edited by Bauzli
Link to comment
Share on other sites

Show your code and the full error log. We're not telepathic.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

7 minutes ago, [NoOneButNo] said:

What is the name of your json files? and the full log?

the name of both json files is carved_oak_log.json, the texture file is carved_oak_log.png. Both Blockstate and Model files are the corresponding oak log Models and Blockstates copied and changed.

 

I don't really know what you mean with "The full log", but this is the 4 lines before it. Everything else is not related to the issues.

 

[20:55:39.305] [Server-Worker-4/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'testmod:blockstates/carved_oak_log.json' in resourcepack: 'main' for variant: 'axis=z': Unknown blockstate property: 'axis'
[20:55:39.305] [Server-Worker-4/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'testmod:blockstates/carved_oak_log.json' in resourcepack: 'main' for variant: 'axis=x': Unknown blockstate property: 'axis'
[20:55:39.306] [Server-Worker-4/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'testmod:blockstates/carved_oak_log.json' in resourcepack: 'main' for variant: 'axis=y': Unknown blockstate property: 'axis'
[20:55:39.306] [Server-Worker-4/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'testmod:blockstates/carved_oak_log.json' missing model for variant: 'testmod:carved_oak_log#'

 

 

Link to comment
Share on other sites

2 minutes ago, [NoOneButNo] said:

Sounds like you did not properly implemented your blockstate "axis".

Like i said, i just copied the oak log blockstate json over and changed the model names so they reference the model of my block. Do i have to create the axis blockstate itself myself?

Link to comment
Share on other sites

3 minutes ago, [NoOneButNo] said:

Yes since you are not overriding the vanilla class responsible for that blockstate.

 

Edit: Extending. Or making a new one while implementing that blockstate.

I am pretty new to this so...what does that mean? I have basic understanding of Java, but if you don't wanna explain yourself, do you have an idea on where i could find information on how to do this?

 

In the Vanilla assets, there is no axis.json file, so now i'm confused.

Link to comment
Share on other sites

public class RotatedPillarBlock extends Block {
   public static final EnumProperty<Direction.Axis> AXIS = BlockStateProperties.AXIS;

   public RotatedPillarBlock(Block.Properties properties) {
      super(properties);
      this.setDefaultState(this.getDefaultState().with(AXIS, Direction.Axis.Y));
   }

   /**
    * Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed
    * blockstate.
    * @deprecated call via {@link IBlockState#withRotation(Rotation)} whenever possible. Implementing/overriding is
    * fine.
    */
   public BlockState rotate(BlockState state, Rotation rot) {
      switch(rot) {
      case COUNTERCLOCKWISE_90:
      case CLOCKWISE_90:
         switch((Direction.Axis)state.get(AXIS)) {
         case X:
            return state.with(AXIS, Direction.Axis.Z);
         case Z:
            return state.with(AXIS, Direction.Axis.X);
         default:
            return state;
         }
      default:
         return state;
      }
   }

   protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
      builder.add(AXIS);
   }

   public BlockState getStateForPlacement(BlockItemUseContext context) {
      return this.getDefaultState().with(AXIS, context.getFace().getAxis());
   }
}

 

This is an example of  a vanilla block that implements it. Take your time and read it meanwhile Im gonna go get some sleep.

Link to comment
Share on other sites

2 minutes ago, Bauzli said:

In the Vanilla assets, there is no axis.json file, so now i'm confused

It isn't sn asset. It is a property of logs. Go look at one of the log json files.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

34 minutes ago, Draco18s said:

It isn't sn asset. It is a property of logs. Go look at one of the log json files.

Thanks.This would mean that i can -somehow- add this property to my block and it would work.

 

35 minutes ago, [NoOneButNo] said:

public class RotatedPillarBlock extends Block {
   public static final EnumProperty<Direction.Axis> AXIS = BlockStateProperties.AXIS;

   public RotatedPillarBlock(Block.Properties properties) {
      super(properties);
      this.setDefaultState(this.getDefaultState().with(AXIS, Direction.Axis.Y));
   }

   /**
    * Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed
    * blockstate.
    * @deprecated call via {@link IBlockState#withRotation(Rotation)} whenever possible. Implementing/overriding is
    * fine.
    */
   public BlockState rotate(BlockState state, Rotation rot) {
      switch(rot) {
      case COUNTERCLOCKWISE_90:
      case CLOCKWISE_90:
         switch((Direction.Axis)state.get(AXIS)) {
         case X:
            return state.with(AXIS, Direction.Axis.Z);
         case Z:
            return state.with(AXIS, Direction.Axis.X);
         default:
            return state;
         }
      default:
         return state;
      }
   }

   protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
      builder.add(AXIS);
   }

   public BlockState getStateForPlacement(BlockItemUseContext context) {
      return this.getDefaultState().with(AXIS, context.getFace().getAxis());
   }
}

 

I'm not advanced enough in Java to fully understand whats going on here, and i don't make a new class for the new Blocks i create. So i don't really know how to register a block that is in a whole new class.

Link to comment
Share on other sites

29 minutes ago, Bauzli said:

i don't really know how to register a block that is in a whole new class.

Its just like registering a block that isn't a whole new class.

Except you call new on a different class.

Shocking, I know.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

16 hours ago, [NoOneButNo] said:

Sounds like you need to learn inheritance some more. This is actually basic polymorphism...

Yeah i know heritance fully, but to me writing mods in forge seems almost like a new language, especially because i have never worked with json before.

 

18 hours ago, Draco18s said:

Its just like registering a block that isn't a whole new class.

Except you call new on a different class.

Shocking, I know.

Thanks, actually fixed my issue.

 

So thank all of you guys, you've actually both really helped me understand the registry process and how minecraft works codewise way more.

Edited by Bauzli
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

    • 밤의전쟁시즌2 방송 ↖ºBCGAME88ºC0Mº-▲ 토렌트모바일 카지노펍 알파비엣 토렌트모바일 바카라펍 조이앤조이 gk7n1 ↖ 토렌트모바일 주소 코리아배팅 토렌트모바일 업체 LIVESCORE. IN vf7e7 ★ 토렌트모바일 단톡방 XX조아 토렌트모바일 여행 핀한 bd2t7 ↙ 토렌트모바일 본사 토렌트후 토렌트모바일 토너먼트 풀발닷컴 um6a4 ☏ 토렌트모바일 투어 토토마스터즈 토렌트모바일 토너먼트 토토씨피알 na9h3 ◇ 토렌트모바일 방송 신세계인터내셔날 토렌트모바일 영상 하루툰 uw3k0 ▷ 토렌트모바일 업체 먹튀원칙 토렌트모바일 바카라펍 핫타이 bl0c5 → 토렌트모바일 주소 넷플릭스 토렌트모바일 경기 뽐뿌 ke2j4 # 토렌트모바일 바카라펍 신짜오베트남 토렌트모바일 중계 토토데이 kt7f5 → 토렌트모바일 주소 저세상 토렌트모바일 도박장 호빵넷 xi8u9 → 토렌트모바일 홀덤펍 필리핀올 토렌트모바일 토너먼트 토복이 rg6i3 № 토렌트모바일 게임 토토베이 토렌트모바일 모집 펀링크 yl7n1 ▷ 토렌트모바일 본사 ANCA7 토렌트모바일 방법 롯데시네마 gr8f2 ㏘ 토렌트모바일 검증 호주나라 토렌트모바일 영상 마나툰 rj1t8 ♤ 토렌트모바일 모집 오즈티비 토렌트모바일 투어 오피굿밤 co8m5 ☎
    • 오피오피걸 경기 ☆ºBCGAME88ºC0Mº-º 오피핫플 중계 ew-studio 오피핫플 홀덤바 하루야동 dh3y9 ♬ 오피핫플 전략 아지툰 오피핫플 주소 유유닷컴 mi9h9 & 오피핫플 게임장 오피타임 오피핫플 방송 프릭툰 os0s0 º 오피핫플 쿠푼 미얀마리아 오피핫플 전략 필고 ch2a9 ↔ 오피핫플 도박장 벳팡 오피핫플 모집 오라카이 ji6h7 ♣ 오피핫플 경기 슈어맨 오피핫플 본사 해피코리아 xj7j5 ↙ 오피핫플 동영상 일간베스트 오피핫플 단톡방 송송넷 gw0b5 → 오피핫플 유투브 오피일번지 오피핫플 방송 토쟁이닷컴 mp4j5 ▧ 오피핫플 토너먼트 하이몽골리아 오피핫플 업체 애니365 ej2t5 ▽ 오피핫플 전략 나이트몰 오피핫플 본사 SUPERTV bb5n4 ◎ 오피핫플 검증 야딸이 오피핫플 리그 골드인시티 lu0g8 ★ 오피핫플 모집 골드인시티 오피핫플 홀덤펍 스페인어게인 xy6c1 ♩ 오피핫플 바카라펍 중개소 오피핫플 본사 네임드툰 ng3w0 ☆ 오피핫플 검증 벳어게인 오피핫플 단톡방 밤인싸 jp7e6 ▥ 오피핫플 카지노펍 짱그라 오피핫플 주소 펜사람닷컴 iw2j4 ♭
    • 라이브 토토 토너먼트☜BCGAME88·COM▧ 모잠비크 토토 도박장 라이브 크라운카지노 토토 추천 [본사문의 텔레 JBOX7]라이브 토토 ◀◐ 본사 말리 토토 검증 라이브 크로아티아 라이브 토토 쿠푼 [총판문의 카톡 JBOX7]라이브 토토 ◐& 동영상 토바고 토토 캐쉬게임 라이브 이비자그란카지노 라이브 토토 동영상 [각종 오피 커뮤니티 제작]라이브 토토 @▽ 본사 수단 토토 포커대회 라이브 서아시아 라이브 토토 모집 [마케팅문의]라이브 토토 ♥◁ 리그 니카라과 토토 모집 라이브 인도네시아 라이브 토토 유투브 [카지노본사]라이브 토토 ♠● 유투브 벨라지오카지노 토토 본사 라이브 가이아나 라이브 토토 투어 [스포츠본사]라이브 토토 ♡◑ 본사 카타르 토토 사이트 라이브 인도 라이브 토토 홀덤바 [토토본사 문의]라이브 토토 ↔♭ 바카라펍 토고 토토 캐쉬게임 라이브 남아메리카 라이브 토토 놀이터 [토토총판 구매]라이브 토토 ※㈜ 도박장 폴스뷰카지노 토토 투어 라이브 토바고 라이브 토토 여행 [카지노총판]라이브 토토 ↔§ 업체 오세아니아 토토 투어 라이브 솔로몬제도 라이브 토토 동영상 [야마토본사]라이브 토토 ♠▒ 모집 우크라이나 토토 유투브 라이브 바레인 라이브 토토 카지노펍 [바카라총판]라이브 토토 ▤☏ 단톡방 바티칸시국 토토 투어 라이브 엘살바도르 라이브 토토 놀이터 [경마총판]카타르 토토 놀이터 몽골 토토 게임장 [BCGAME 비씨게임 총판문의]알림 설정 추천 구독 좋아요
    • 아시아 올림픽 중계♣BCGAME88·COM▶ 우크라이나 올림픽 리그 아시아 브루나이 올림픽 유투브 [본사문의 텔레 JBOX7]아시아 올림픽 ◀♣ 게임 카자흐스탄 올림픽 홀덤바 아시아 벨라루스 아시아 올림픽 리그 [총판문의 카톡 JBOX7]아시아 올림픽 ▧♩ 쿠푼 콩고 올림픽 홀덤바 아시아 덴마크 아시아 올림픽 커뮤니티 [각종 오피 커뮤니티 제작]아시아 올림픽 ↖△ 캐쉬게임 알바니아 올림픽 업체 아시아 네덜란드 아시아 올림픽 모집 [마케팅문의]아시아 올림픽 ↙▨ 중계 라트비아 올림픽 캐쉬게임 아시아 동남아 아시아 올림픽 게임 [카지노본사]아시아 올림픽 ●▼ 경기 소말리아 올림픽 도박장 아시아 부탄 아시아 올림픽 게임 [스포츠본사]아시아 올림픽 ▷▽ 유투브 BCGAME카지노 올림픽 유투브 아시아 MGM카지노 아시아 올림픽 방법 [토토본사 문의]아시아 올림픽 ◎◑ 추천 트리니다드 올림픽 유투브 아시아 콩고 아시아 올림픽 놀이터 [토토총판 구매]아시아 올림픽 ♧▲ 검증 가이아나 올림픽 게임장 아시아 레바논 아시아 올림픽 게임 [카지노총판]아시아 올림픽 @§ 접속 벨리즈 올림픽 캐쉬게임 아시아 상투메프린시페 아시아 올림픽 유투브 [야마토본사]아시아 올림픽 ※□ 카지노펍 조지아 올림픽 주소 아시아 코스타리카 아시아 올림픽 투어 [바카라총판]아시아 올림픽 @㈜ 총판 토고 올림픽 게임장 아시아 아리아카지노 아시아 올림픽 영상 [경마총판]시리아 올림픽 홀덤펍 앤티가바부다 올림픽 주소 [BCGAME 비씨게임 총판문의]알림 설정 추천 구독 좋아요
    • 조선의밤 캐쉬게임 ▼ºBCGAME88ºC0Mº-▦ 먹튀골든타임 놀이터 토렌트 먹튀골든타임 카지노펍 조지아주닷컴 cq5w4 * 먹튀골든타임 싸이트 각TV 먹튀골든타임 업체 빅뱅 mg9j6 ■ 먹튀골든타임 유투브 섹시스토리 먹튀골든타임 본사 스코어맨 ws5d4 ▶ 먹튀골든타임 전략 토렌트유 먹튀골든타임 접속 섹스밤 bw9s2 ◁ 먹튀골든타임 게임장 코린디아 먹튀골든타임 사이트 침대툰 ye0k9 ▽ 먹튀골든타임 전략 교포신문 먹튀골든타임 방송 토렌트하자 ct3q1 ㉿ 먹튀골든타임 주소 헌병대 먹튀골든타임 게임 야관문 ti9p7 ☏ 먹튀골든타임 포커대회 토뱅 먹튀골든타임 홀덤펍 마사지맵 yi6n8 ◈ 먹튀골든타임 방송 마사데이 먹튀골든타임 동영상 노브라 ck6l8 ▼ 먹튀골든타임 게임 먹튀슈퍼맨 먹튀골든타임 게임 토토코리아 os2p0 ♬ 먹튀골든타임 동영상 섹툰 먹튀골든타임 검증 HBO ev7c0 ♨ 먹튀골든타임 캐쉬게임 AV스위치 먹튀골든타임 게임장 호치민한인회 gf2n1 ○ 먹튀골든타임 검증 알파비엣 먹튀골든타임 추천 밤인싸 qo5v9 ☜ 먹튀골든타임 도박장 나이트몰 먹튀골든타임 총판 라이브스코어 yp3d0 ☎ 먹튀골든타임 투어 하루야동 먹튀골든타임 접속 카지노탑섬 dr9s0 ♪
  • Topics

×
×
  • Create New...

Important Information

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