Jump to content

[1.19.2] How to hide or make transparent vanilla blocks?


SoLegendary

Recommended Posts

For some context, since this sounds like something trying to make a cheat mod would be doing, I have a mod that has you play Minecraft in a top-down perspective controlling mobs as units in a strategy game.

https://www.youtube.com/watch?v=2kL4vyjE2Mc

One issue I have right now is that forests are very difficult to move through because you can't easily see your mobs through leaves.

To combat this, I want to be able to make these vanilla leaf blocks either completely hidden or transparent at specific locations (I know where all of the required BlockPoses will be to do this). Ideally I would like them to be transparent, but if they their rendering can be cancelled entirely, I can also render blocks which are partially transparent (eg. glass) in their place to achieve the same effect.

Another idea I had was to have all vanilla leaf blocks replaced by some equivalent custom block that I have control over, but that would be a lot of work and I wanted to know if I could do it without that first before attempting it.

Edited by SoLegendary
formatting
Link to comment
Share on other sites

Ok actually nevermind, I found I can cancel BlockRenderDispatcher.renderBatched with a mixin to hide the blocks entirely.

If there a way to do the transparency route though I would still like to know as that will mean I can retain the leaf texture instead of having to use some other transparent block.

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 test with other forge version and this work
    • Also add the latest.log (logs-folder) with sites like https://paste.ee/ and paste the link to it here
    • Add the crash-report or latest.log (logs-folder) with sites like https://paste.ee/ and paste the link to it here  
    • Hi, I'm trying to add a chance for the LootTableIdCondition. I've tried to manipulate the AddItemModifier class, but it still doesn't work: public class AddItemModifier extends LootModifier { public static final Supplier<Codec<AddItemModifier>> CODEC = Suppliers.memoize(() -> RecordCodecBuilder.create(inst -> codecStart(inst).and(ForgeRegistries.ITEMS.getCodec() .fieldOf("item").forGetter(m -> m.item)) .and(Codec.FLOAT.fieldOf("chance").forGetter(m -> m.chance)) .apply(inst, AddItemModifier::new))); private final Item item; public AddItemModifier(LootItemCondition[] conditionsIn, Item item) { super(conditionsIn); this.item = item; } @Override protected @NotNull ObjectArrayList<ItemStack> doApply(ObjectArrayList<ItemStack> generatedLoot, LootContext context) { if(context.getRandom().nextFloat() < chance) { generatedLoot.add(new ItemStack(this.item)); } for(LootItemCondition condition : this.conditions) { if(!condition.test(context)) { return generatedLoot; } } generatedLoot.add(new ItemStack(this.item)); return generatedLoot; } @Override public Codec<? extends IGlobalLootModifier> codec() { return CODEC.get(); } } the only problem is the two "chance" are not defined, but when I add a private final Float chance, the AddItemModifier::new is in red underline, and there's an error. Is there a way to solve this, or is there another better way to add a chance to chest loot modifiers?
    • When i join every modapack 1.12.x and i press fullscreen it crash and it continue until reinstall
  • Topics

×
×
  • Create New...

Important Information

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