Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

urbanxx001

Members
  • Posts

    181
  • Joined

  • Last visited

Everything posted by urbanxx001

  1. I'd recommend a tutorial based on McJty's code, HarryTalks, as well as MBE80 by TGG. From your previous thread it looks like you want to create a mob that floats and passes through walls. I would take a look at how the Vex handles it.
  2. Yup it uses a ton of ASM voodoo magic
  3. Hi Rinjikii, packages are essentially the same as folder directories that you'd use on your computer. When creating your mod you'll place your java files in packages, while your resources, which contains blockstates, textures, etc., uses folders. Once you have the conventional directory com.author_name.mod_name, the package structure is up to you.
  4. I would take a look at StackUp! Mod's source. Hopefully it's adjustable from 1.13 to 1.16.
  5. Within the method that performs the mining action you can find a list of ItemEntities mined with getEntitiesWithinAABB() of the block's position, and filter to only find dirt, stone, etc. Once you have the entities you can teleport them to the block position above the mining block with teleportTo() or something similar.
  6. The mob is complete and it spawns fine with an egg, but I'm having trouble spawning it in biomes. I've: Registered mob placement in the common startup event with: EntitySpawnPlacementRegistry.register(MY_MOB, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, MyMobEntity::checkSpawnRules); With the following spawn rules: public static boolean checkSpawnRules(EntityType<? extends AnimalEntity> p_223325_0_, IServerWorld p_223325_1_, SpawnReason p_223325_2_, BlockPos p_223325_3_, Random p_223325_4_) { return p_223325_1_.getDifficulty() != Difficulty.PEACEFUL && MonsterEntity.isDarkEnoughToSpawn(p_223325_1_, p_223325_3_, p_223325_4_) && checkMobSpawnRules(p_223325_0_, p_223325_1_, p_223325_2_, p_223325_3_, p_223325_4_); } And added a method in a BiomeLoadingEvent that adds the spawn whenever an enderman is present in a biome's spawn list: @SubscribeEvent public static void onBiomeLoad(BiomeLoadingEvent event) { MobSpawnInfoBuilder spawns = event.getSpawns(); Set<EntityType<?>> entityTypes = spawns.getEntityTypes(); for (EntityType<?> entityType : entityTypes) { if (entityType == EntityType.ENDERMAN) { int weight = 10; if (event.getCategory() == Biome.Category.NETHER) { weight = 1; } spawns.addSpawn(EntityClassification.CREATURE, new MobSpawnInfo.Spawners(ModEntities.MY_MOB, weight, 1, 4)); break; } } } I expected to see many of my mob roaming around the End. Any help is appreciated.
  7. Ah ok I'm sorry to hear that. I dug a little and it appears if occlusion doesn't solve it, then it might be an issue with Forge's lighting engine and/or model loading, according to this issue thread. To summarize, the engine is particular about vertex ordering in the model, which means certain sides are incorrectly taking the lighting values that should be applied to other sides. The only thing I can suggest is enabling an experimental feature in Forge's config called experimentalForgeLightingPipelineEnabled.
  8. The darkness is associated with ambient occlusion, in your block class you can modify this with: @Override public float getAmbientOcclusionLightValue(BlockState state, IBlockReader worldIn, BlockPos pos) { return (some float); } I've found that small values (usually around 0.1F) reduce the dark. Alternatively in your block model json you can disable or enable occlusion with: "ambientocclusion": true/false
  9. I'm attempting to add a fire-like overlay to a mob when a certain condition is present. Nothing has crashed, but no overlay appears. The code is adapted for a RenderLivingEvent directly from the #renderEntityStatic method in EntityRendererManager. I don't believe the issue has to do with the texture stitching event, but I could be wrong. ModSubscribeEvents
  10. I'll try to help, but the only type of Config I've written is a Common type, if this is something specific to Server type. Is this only happening after editing certain config options or any of them? Nothing appears wrong with the numerical range configs
  11. Ah you're right how did I miss that... thanks. Right now I'm creating a connected block using a custom blockstate property and several checks in #updatePostPlacement, however something about the loops I have is freezing the game after the 5th or 6th block of the same type, would try to remedy it with the aforementioned method but will seek a different solution.
  12. Reverse searching "Processor failed, invalid outputs" in your log led to a similar post. The solution there was updating Java. Not entirely sure if this is the same issue though.
  13. Hi, welcome to the Forum! It'll help if you post the full error log in a pastebin. It can be found in (mod folder root) > run > logs > latest.log.
  14. So it might have to do with the version that I'm using (1.16.1-32.0.108) but I'm unable to override the public method #getValidBlockforPosition in my custom block which extends the Block class. The issue has nothing to do with an unmapped name like func_12345. I could see if an AT makes a difference even though it's redundant?
  15. So I'm probably overthinking this, but I have an itemstack with nbt and now it needs to be converted to an item to register for a villager trade. Normally this would be #getItem(), but that just returns the item type. Here it's recommended to override the methods associated with the context of the item's use, but that boils down to interacting with code that still uses itemstack. Edit: Nvm forgot my code for generating trades uses itemstacks directly, got it working with that.
  16. Tried that, it still gives the error. Pretty bizarre. I might just try transferring all the code to a new gradle project.
  17. This was completely out of left field; upon loading Forge, it crashes with a "No class 'TypeResolver' found" error. I'm not sure what it points to since no code changes took place between now and when it last loaded fine. Error log: https://pastebin.com/QFJsXj1q
  18. That makes a ton of sense now... it's strange that it's set like that though, if ImageButton has a constructor that accepts text, you would think it would render on the button by default. Normally it just passes StringTextComponent.field_240750_d_ (an empty string), so having another hurdle seems redundant.
  19. I recommend taking a look at the Forge documentation for events. In your Main class, the mod event bus is added as: @Mod(Main.MOD_ID) @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class Main { public static final String MOD_ID = "mod_id"; public Main() { final IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus(); eventBus.addListener(this::onCommonSetup); eventBus.addListener(this::onClientSetup); } private void onClientSetup(FMLClientSetupEvent event) { registerColors(); } } Alternatively, if you do the subscribe event, Poopoodice is saying you can get the colors from the event like: BlockColors blockcolors = event.getBlockColors();
  20. Yeah it can be handled like that if you get it from the event, the way it was done with the instance is adding it to FMLClientSetupEvent.
  21. One way to add Biome colors to blocks is by registering directly in the client proxy. A few different examples below. In your case, the example with the oak hedge will let your block change with biome, and change getFoliageColor() to getWaterColor(). private void registerColors() { BlockColors blockcolors = Minecraft.getInstance().getBlockColors(); ItemColors itemcolors = Minecraft.getInstance().getItemColors(); blockcolors.register((state, world, pos, tintIndex) -> 12665871, ModBlocks.HEDGE_RED_MAPLE); blockcolors.register((state, reader, pos, i) -> FoliageColors.getSpruce(), ModBlocks.SPRUCE_LEAF_CARPET, ModBlocks.HEDGE_SPRUCE); blockcolors.register((state, reader, pos, i) -> reader != null && pos != null ? BiomeColors.getFoliageColor(reader, pos) : FoliageColors.getDefault(), ModBlocks.OAK_LEAF_CARPET, ModBlocks.HEDGE_OAK, itemcolors.register((stack, i) -> { BlockState state = ((BlockItem)stack.getItem()).getBlock().getDefaultState(); return blockcolors.getColor(state, null, null, i); }, ModBlocks.OAK_LEAF_CARPET, ModBlocks.HEDGE_OAK, ModBlocks.SPRUCE_LEAF_CARPET, ModBlocks.HEDGE_SPRUCE, ModBlocks.HEDGE_RED_MAPLE); }
  22. So this seems like a bug, but it could be a drawing issue I'm not aware of. I have an ImageButton and regular Button: this.func_230480_a_(new ImageButton(xstart + 99, ystart + 18, 70, 16, 156, 0, 21, WIDGET_TEXTURES, 256, 256, (p_213070_1_) -> { }, new TranslationTextComponent("Image Button"))); this.func_230480_a_(new Button(xstart + 99, ystart + 18, 70, 20, new TranslationTextComponent("Button"), (p_213070_1_) -> { })); Both textures render fine, however the ImageButton doesn't display text. This is odd considering they both output the same arguments below. I also tried to give the ImageButton text color to see if it would make a difference, but it doesn't. TranslatableComponent{key='Image Button', args=[], siblings=[], style=Style{ color=null, bold=null, italic=null, underlined=null, strikethrough=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null, font=minecraft:default}} TranslatableComponent{key='Button', args=[], siblings=[], style=Style{ color=null, bold=null, italic=null, underlined=null, strikethrough=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null, font=minecraft:default}}
  23. Yeah toggling the visibility is an option. However this is usually only possible by clicking on the button, which can't be done in this case. Now that I think about it, the game rule menu for creating a world has scrolling buttons, I’ll take a look there. Edit: ok I didn't realize you could access the widgets with this.field_230710_m_ ..smh these auto-generated names.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.