Jump to content

nil

Members
  • Posts

    52
  • Joined

  • Last visited

Everything posted by nil

  1. I'm trying to create a block which uses a custom model and is rotatable on an axis like wood blocks. The specific error is: [02:54:06] [Server-Worker-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'jdyntreesmod:blockstates/block_oak_medium.json' missing model for variant: 'jdyntreesmod:block_oak_medium#axis=y' [02:54:06] [Server-Worker-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'jdyntreesmod:blockstates/block_oak_medium.json' missing model for variant: 'jdyntreesmod:block_oak_medium#axis=z' [02:54:06] [Server-Worker-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'jdyntreesmod:blockstates/block_oak_medium.json' missing model for variant: 'jdyntreesmod:block_oak_medium#axis=x' [02:54:06] [Server-Worker-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'jdyntreesmod:blockstates/block_oak_medium.json' in resourcepack: 'main': com.google.gson.stream.MalformedJsonException: Expected name at line 6 column 6 path $.variants. The Blockstate File: { "variants": { "axis=y": { "model": "jdyntreesmod:models/blocks/model_block_oak_medium" }, "axis=z": { "model": "jdyntreesmod:models/blocks/model_block_oak_medium", "x": 90 }, "axis=x": { "model": "jdyntreesmod:models/blocks/model_block_oak_medium", "x": 90, "y": 90 }, } } Before you ask: i removed the axis=none line because it was throwing the following error [02:54:06] [Server-Worker-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'jdyntreesmod:blockstates/block_oak_small.json' in resourcepack: 'main' for variant: 'axis=none': Unknown value: 'none' for blockstate property: 'axis' [x, y, z] The code i used to create the java File is identical to RotatedPillarBlock (For testing purposes) This is the Model .json { "credit": "Made with Blockbench", "parent": "minecraft:block/block", "ambientocclusion": false, "texture_size": [32, 16], "textures": { "particle": "jdyntreesmod:blocks/block_oak_medium" }, "elements": [ { "name": "oakLogMedium", "from": [3, 1, 3], "to": [13, 16, 13], "rotation": {"angle": 0, "axis": "z", "origin": [13, 16, 3]}, "faces": { "north": {"uv": [2.5, 5, 5, 12.5], "texture": "#particle"}, "east": {"uv": [0, 5, 2.5, 12.5], "texture": "#particle"}, "south": {"uv": [7.5, 5, 10, 12.5], "texture": "#particle"}, "west": {"uv": [5, 5, 7.5, 12.5], "texture": "#particle"}, "up": {"uv": [5, 5, 2.5, 0], "texture": "#particle"}, "down": {"uv": [7.5, 0, 5, 5], "texture": "#particle"} } } ], "display": { "thirdperson_righthand": { "rotation": [75, 45, 0], "translation": [0, 2.5, 0], "scale": [0.375, 0.375, 0.375] } } } Is the axis=none line the cause of the issue? If so, what can i do to fix the error associated with it? I hate jsons.
  2. So this means i have to rewrite everything is that correct?
  3. What would be the best/easiest way to update a mod from 1.12 to 1.14 or where can i find out how do this?
  4. I wrote a renderer for a custom projectile and everything works fine except the texture, which is just completely black. What can cause this? Bindtexture is called in the renderer. Any help would be appreciated. Also can sb link me a tutorial where i can learn more about how renderers work?
  5. Is there anything specific i have to add to the model or entity classes in order for the item to render? I'm using the ModelSkeleton code in my model class, so i probably can't post it here. The entity is using the item to shoot things, it just isn't rendering.
  6. For some reason i had in memory that all blocks could be set on fire like flammable blocks can. Everything is fine.
  7. It always sets the air block to "vertical" fire. Not sure why, that's my question.
  8. The issue is that if the block is hit from the side it will spawn a fire block which will then instantly disappear if there is no block beneath the air block which was set to fire, instead of setting the fire to be on the blocks side.
  9. I used if (this.world.isAirBlock(blockpos) && this.element == SpellElement.FIRE) { this.world.setBlockState(blockpos, Blocks.FIRE.getDefaultState()); } to set fire to blocks, however this doesn't set fire to the block if it's hit from the side. How do i do that?
  10. The projectile is completely black, not texture-error black with purple, just black. The brightness of the projectile is not the issue, i set it to a large value and it didn't change anything. The class is here. If possible, pls explain the issue, thx.
  11. When the projectile is shot, it almost never lines up with the crosshair and seems to be controlled partially by the players last movement, even thought the parts of the method that should be responsible for this are disabled. The complete class is here. What do i need to change?
  12. Since the class is rather large what would be the best way to share it here?
  13. I assume you mean this.world.checkLightFor(EnumSkyBlock.BLOCK,new BlockPos((int) x, (int) y, (int) z)); The issue is that my entity is a projectile, which means that it creates light at loads of different x,y and z positions. So i tried to remove the light the following way: if (this.emitsLight) { double x = 0; double y = 0; double z = 0; if(hasPrevLight) { removeLight(x,y,z); } this.addLight(10); x = this.posX; y = this.lastTickPosY; z = this.lastTickPosZ; this.hasPrevLight = true; } with hasPrevLight set to false when the entity is spawned and private void removeLight(double x, double y, double z) { this.world.checkLightFor(EnumSkyBlock.BLOCK,new BlockPos((int) x, (int) y, (int) z)); } Sadly this doesn't remove the lighting along the path.
  14. The method you use works almost perfectly, however, the lighting effect doesn't get removed even after the entity is long dead. Do you use any methods to clear the created lighting? I have never used a tessellator, are there any examples i can look at to get a better understanding of this? Also what do you mean by vertex format?
  15. I meant in this specific area in my code, my bad.
  16. I'm trying to set lighting for a custom projectile entity. Is there somewhere i can check the correct usage of this? I can't decifer what int p_187314_1_ and int p_187314_2_ do / how i have to set them. Does this contain BufferBuilder#lightmap()?
  17. It's never the case, i don't even know why i didn't just use this.world in the first place. Everything works now. Thx.
  18. What methods can i use to set lighting on entities and blocks?
  19. I'm trying to get a custom projectile to set fire to blocks in the method onhit(raytraceResult) like this: BlockPos blockpos = raytraceResultIn.getBlockPos(); //blockpos = blockpos.add(0, 1, 0); IBlockState iblockstate = this.world.getBlockState(blockpos); if (raytraceResultIn.entityHit.world.isAirBlock(blockpos)) { raytraceResultIn.entityHit.world.setBlockState(blockpos, Blocks.FIRE.getDefaultState(), 11); } this.setDead(); similar to ItemFlintAndSteel. However it always crashes the world when used, causing a TickingEntity error. What is the correct way to have projctile set fire to a block?
  20. If you are trying to set the base value for the entity's max health you can use applyEntityAttributes(). Look at EntityZombie.applyEntityAttributes() for reference on both.
  21. I tried getting a tipped arrow like this: ItemStack item = new ItemStack(Items.TIPPED_ARROW,1,5); however the shot arrow is always a generic tipped arrow without any effects. This is the method i use this in: @Override protected EntityArrow getArrow(float p_190726_1_) { Random rand = new Random(); EntityArrow entityarrow = super.getArrow(p_190726_1_); if (rand.nextInt(2) == 0) { ItemStack item = new ItemStack(Items.TIPPED_ARROW,1,5); ((EntityTippedArrow)entityarrow).setPotionEffect(item); return entityarrow; } else { return entityarrow; } }
  22. If i want to use EntityLiving.setRevengeTarget on an Entity that extends a passive mob do i have to set a damage value or sth. like that for this method to work?
  23. I'm trying to check if the Entity was hurt by the player via LivingHurtEvent, but i'm not sure what i can use to get the player as a damage source.
×
×
  • Create New...

Important Information

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