Everything posted by Sinu
-
[1.16.5] Giving potion effect based on the light level of the block player is standing on
Thanks for the reply. I will work around it for now!
-
[1.16.5] Giving potion effect based on the light level of the block player is standing on
Sweet, that seems to have worked! The one issue is that, I had to check if the instance was client or server because for some reason the server kept thinking the light level of the player is always 0 (is it client-side only?). So my code looks like this now: PlayerEntity player = event.player; World world = event.player.level; BlockPos blockpos = player.blockPosition(); BlockState block = world.getBlockState(blockpos); if (world.isClientSide) { System.out.print(world.getMaxLocalRawBrightness(blockpos) + System.lineSeparator()); if (world.getMaxLocalRawBrightness(blockpos) == 0) { ((LivingEntity)event.player).addEffect(new EffectInstance(Effects.BLINDNESS, 20, 3)); } } But now once I walk out of the light level of 0, it still says that I have the Blindness effect even though I can see clearly. I am assuming that since I checked if the instance is client-side or not, it didn't actually give the potion effect according to the server (which makes sense) but I don't understand why Blindness goes away even after I walk into the light?
-
[1.16.5] Replace block after it's broken
Thanks, that seems to have worked!
-
[1.16.5] Giving potion effect based on the light level of the block player is standing on
I see. What is the second int parameter in World#getRawBrightness for? I looked at the reference and it just seems to subtract it? Not sure why.. Also I believe I tried using World#getBrightness with LightType.BLOCK but I don't think it detected the light level properly. I am trying to give the Blindness effect to players who walk into caves with light levels of 0.
-
[1.16.5] Replace block after it's broken
Will this also work if I put this in BlockEvent.BreakEvent? Let's say I check if the player is breaking a Stone block and trying to replace that with something else.
-
[1.16.5] Giving potion effect based on the light level of the block player is standing on
I am trying to give a blinding effect to players who are in light level of 0 but I can't seem to get it to work. @SubscribeEvent public static void onPlayerTick(TickEvent.PlayerTickEvent event) { PlayerEntity player = event.player; World world = event.player.level; BlockPos blockpos = player.blockPosition(); BlockState block = world.getBlockState(blockpos); if (block.getLightValue(world, blockpos) == 0 && block != null) { ((LivingEntity)event.player).addEffect(new EffectInstance(Effects.BLINDNESS, 20, 3)); } } Am I using getLightValue correctly? Also I am correctly feeding in the correct block position?
-
[1.16.5] Removing vanilla recipes that use Forge tags
So you just downloaded my source code and loaded it up and it doesn't allow you to create the Fishing Rod? I can still craft it and I uploaded exactly as is and I haven't touched it.
-
[1.16.5] Removing vanilla recipes that use Forge tags
How will that fix my crafting issues with fishing_rod.json file when it doesn't even use/reference any tags I added in that folder?
-
[1.16.5] Removing vanilla recipes that use Forge tags
All the ones in data.forge.tags?
-
[1.16.5] Removing vanilla recipes that use Forge tags
I have no idea what you mean either. Can you be more specific? Which json file are you talking about?
-
[1.16.5] Removing vanilla recipes that use Forge tags
For the String and Rods (sticks)?
-
[1.16.5] Removing vanilla recipes that use Forge tags
https://github.com/krimsungh/Brimheim
-
[1.16.5] Removing vanilla recipes that use Forge tags
Well I can still craft the Fishing Rod even after I changed it.
-
[1.16.5] Removing vanilla recipes that use Forge tags
Right. I get that. But what is my "dependencies"? [[dependencies.???]] my own mod ID?? I know its definitely not examplemod. I did: [[dependencies.brimheim]] modId="forge" mandatory=true versionRange="[36,)" ordering="AFTER" side="BOTH" Is that correct?
-
[1.16.5] Removing vanilla recipes that use Forge tags
So we are talking about the mods.toml inside META-INF folder? Ex: Projects\Minecraft\Brimheim\src\main\resources\META-INF. This is the only mods.toml I can find inside my MDK. But what am I adding dependency of? I get that I need to set the "ordering" to AFTER but what am I setting the "ordering" of? Forge??
-
[1.16.5] Removing vanilla recipes that use Forge tags
Right, I have looked in there. Not exactly sure what I am looking for other than mods.toml file.
-
[1.16.5] Removing vanilla recipes that use Forge tags
From my understanding, the MDK is where the gradle is setup and all its subfolders? I looked in there and I couldn't find anything.
-
[1.16.5] Removing vanilla recipes that use Forge tags
Could you guide me on how I can do that? The only mods.toml file I was able to find was inside my own mod in META-INF folder.
-
[1.16.5] Removing vanilla recipes that use Forge tags
Do you mean that I am putting Forge as my dependency and setting "ordering" to AFTER? If so, would it look like this? [[dependencies.forge]] modId="forge" mandatory=true versionRange="[36,)" ordering="NONE" side="BOTH" (not 100% sure how to reference Forge as my dependency. Assuming it's just "dependencies.forge")
-
[1.16.5] Removing vanilla recipes that use Forge tags
I've been trying to remove several vanilla recipes and realized the ones I am trying to remove don't work because they use tags by Forge. For example, I can easily remove the Melon recipe but I can't remove Fishing Rod recipe. I copied over the file from vanilla datapack and put it in data.minecraft.recipes with the same naming format (for example: melon.json or fishing_rod.json) and changed the output to air and it does not work for the Fishing Rod recipe. This is also true for other recipes that use tags by Forge. I also read this forum post from a while back: But I am not understanding how this user was able to replace Forge recipes. Here is vanilla fishing_rod.json file: https://hatebin.com/zqhejklbgm Here is my fishing_rod.json file put in data.minecraft.recipes: https://hatebin.com/quqkzvlrhj
-
[1.16.5] Dynamic texture based on stack size?
Actually I figured it out. Instead of doing SubscribeEvent, I just registered it to my main method with: FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); private void doClientStuff(FMLClientSetupEvent event) { event.enqueueWork(() -> { ItemModelsProperties.register(BrimheimItems.COIN_BRONZE.get(), new ResourceLocation(Brimheim.MODID, "stack"), (stack, world, entity) -> { return stack.getCount(); }); }); }
-
[1.16.5] Dynamic texture based on stack size?
I think I got a hang of what I should be doing but I think I am doing something wrong. My json file looks like this which I think is correct: { "parent": "item/generated", "textures": { "layer0": "brimheim:items/coin_bronze" }, "overrides": [ { "predicate": { "brimheim:stack": 16 }, "model": "brimheim:item/coin_bronze_stack" }, { "predicate": { "brimheim:stack": 32 }, "model": "brimheim:item/coin_bronze_bag" } ] } and this is my FMLClientSetupEvent event: @Mod.EventBusSubscriber(modid = Brimheim.MODID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD) public class BrimheimClient { @SubscribeEvent public void setModelProperties(final FMLClientSetupEvent event) { event.enqueueWork(() -> { ItemModelsProperties.register(BrimheimItems.COIN_BRONZE.get(), new ResourceLocation(Brimheim.MODID, "stack"), (stack, world, entity) -> { return stack.getCount(); }); }); } } Also, I am not sure if the event method should be public or private. When I had it on private, I had a java.lang.RuntimeException: Illegal private member with @SubscribeEvent annotation error.
-
[1.16.5] Dynamic texture based on stack size?
Where can I find where Forge references the bow to change it's texture? Or does the bow implement it's features differently than the way you explained it? Looking at example codes help me learn the best I think. EDIT: Oh, I think I understand what you mean. I found https://mcforge.readthedocs.io/en/latest/models/overrides/ which seems pretty close to what I want. So from what I am understanding, I am defining a new "predicate" for the item to recognize within the json file? My next question is, where do I insert the FMLClientSetupEvent event? I figured out where to put it! I have trouble editing this line to have it reflect with the number of stacks: return entity != null && stack.getCount() && entity.getActiveItemStack() == stack ? 1.0F : 0.0F; I am assuming I don't need to check if entity is null or not but only have it register the number of item stack?
-
[1.16.5] Dynamic texture based on stack size?
I have been wondering how to make an item change texture based on certain stack sizes? Someone had already posted about this many years back (https://forums.minecraftforge.net/topic/31987-18-texture-dependant-on-stack-size/) but I am wondering how I can go about doing this in 1.16.5? Also, I am pretty new at modding so a little bit of helping hand would be much appreciated! ๐
-
Modpack Server Broken World Generation
After some testing, I have found the mod that is somehow causing this issue. It was Realistic Torches mod. I am running Realistic Torches 3.1.2 for Minecraft 1.16.5 on Forge 1.16.5-36.1.18. Does anyone know if there is a solution for this? I also noticed that this is not entirely a world generation issue. I tried middle-mouse clicking each block that are broken and placing them back down and somehow the game places a new broken block? Each time I middle-mouse click the new broken block, it keeps giving me a whole new broken block. I have never seen this kind of bug before. Does anyone know why this could be happening?
IPS spam blocked by CleanTalk.