Everything posted by warjort
-
[1.18.2] Change Vanilla Minecraft Blocks that have a Custom Tag to my Custom Block?
If you do use that approach, I think you want to further iterate on chunk.getSections() to avoid looking parts of the chunk that are just void/air and are not really there.
-
[1.18.2] Change Vanilla Minecraft Blocks that have a Custom Tag to my Custom Block?
Spitballing: An alternate approach (not using random ticks) would be write your own WorldTickEvent handler that randomly changes blocks. Your world tick handler would iterate over the loaded chunks and choose random blocks in each, applying whatever logic you want. The issue is how to know the loaded chunks. This would probably involve some book-keeping on your part where you keep track of this yourself using the ChunkEvent.Load/Unload event?
-
[1.18.2] Change Vanilla Minecraft Blocks that have a Custom Tag to my Custom Block?
How would minecraft know to call code on a block that doesn't exist yet?
-
Detecting if Entity is Within Block Hitbox
You can do additional checks yourself in that method.
-
[SOLVED] [1.18.2] How to prevent a spawned falling entity to drop items when is destroyed?
If you don't like mixins you can always use an access transformer.
-
[SOLVED] [1.18.2] How to prevent a spawned falling entity to drop items when is destroyed?
The dropItem is only for when your block lands on say a fence and turns into a item. It doesn't stop the block getting placed otherwise. There doesn't appear to be an event where you can handle this. The one thing that behaves like you want is the Anvil and then only if the anvil's damage goes to zero from fall damage. This all hardcoded by mojang. If you use a mixin accessor to change the private field cancelDrop to true it should do what you want (that is what the anvil code does).
-
[1.18.2] Change Vanilla Minecraft Blocks that have a Custom Tag to my Custom Block?
AFAIK, there is no general event for random ticks on any block? The only thing I can see is forge's CropGrowEvent which only applies to StemBlocks.
-
Animation when Entity collides with Player
It looks like you really want to know when an entity is attacked from your code? You might be able to do some tracking yourself with forge's LivingHurtEvent and looking at the DamageSource. Maybe storing the state using a Capability on the entity?
-
Animation when Entity collides with Player
I am saying there is no data to access for entity/entity collisions, minecraft does not track it. And doing an entity search during rendering will likely affect fps.
-
[Version 1.19] Trying to join a server, but I get a DecoderException that says "VarIntArray with size 112 is bigger than 6"
Your mod works fine for me with a production server and client. But I can get the same error as the one shown in your log if I try to connect to a production server from a client started with gradlew runclient I guess there is a difference in the network packets sent by dev and production versions that means they cannot to connect to each other? I don't know if this bug or expected behaviour, I have never tried it before? BTW how is your .git 1G in size? 🙂
-
How do I spawn my feature in the world? [1.16.5]
Do you know a good example? I just tried to find a good example in well known mods and they seem to use a variant of the RegistryEvent/manual register like botania, except mekanism which has its own specialised FeatureDeferredRegistry implementation.
-
How do I spawn my feature in the world? [1.16.5]
Pretty sure it does it that way because it shares the same code with the fabric implementation which doesn't have deferred registration.
-
How do I spawn my feature in the world? [1.16.5]
It depends what version of forge you are using. The old way (1.18 and before) is to use BiomeLoadingEvent. Then use event.getGeneration().addFeature() to add it to the appropriate GenerationStep. For an example, here is Botania adding mystical flowers and mushrooms to the vegetation step https://github.com/VazkiiMods/Botania/blob/0cfa08ebb4828aa48b3231d6db6dd3b70dc7942b/Forge/src/main/java/vazkii/botania/forge/ForgeCommonInitializer.java#L250 Of course you need to register your features to make them useful, see https://github.com/VazkiiMods/Botania/blob/0cfa08ebb4828aa48b3231d6db6dd3b70dc7942b/Xplat/src/main/java/vazkii/botania/common/world/ModFeatures.java 1.19 (still in beta) has overhauled this to use BiomeModifiers:https://forge.gemwire.uk/wiki/Biome_Modifier
-
Detecting if Entity is Within Block Hitbox
You can override BlockBehaviour.entityInside() on your block to detect this. Look at BasePressurePlateBlock (activates the plate) or BaseFireBlock (sets entity on fire).
-
Animation when Entity collides with Player
Entity.horizontalCollision is for colliding with blocks. Minecraft doesn't really do entity/entity collision, except in special cases like item pickup. Those are not events with state stored in the entity, its a special process that uses one of the level.getEntities() search methods. Those won't be appropriate to call during rendering.
-
Java Virtual Machine Launcher Could Not Open File
This is not a forge issue. You have a problem with your java installation. You should reinstall it, but java 7 is very old. Too old for the currently supported forge versions, 1.16.5 needs java 8 and later versions need java 16 or 17 Curseforge has an option in the minecraft java settings to automatically download and use a java version that is suitable for the version of minecraft used by the modpack. Enable that and see if it fixes your problem.
-
Glitchy Bookshelves
If you can reproduce the problem somewhere else, post the log from when you try to place the block. It might show an error or other useful information.
-
Glitchy Bookshelves
There is no error in that log you posted. One thing to try is to move your enchanting table and book shelves to somewhere else. Say 100 blocks away. Or just create a new world and see if you have the same problem. If that fixes your problem then there is something wrong with that chunk where you have the enchanting table. The fact you originally noticed the problem when it didn't respond to you placing a block and the enchanting table is not recognising the book shelves suggests it is not a graphical glitch. It sounds like a "ghost block" but mojang are supposed to have fixed that problem, and usually relogging fixes it anyway. It is caused by the client and server disagreeing on whether a block exists in a location.
-
1.18.2 - Server crashes on registering ItemProperties
This is happening in your constructor when you register with the EventBus. Forge is examining your class and it is finding a reference to ClientLevel either in one of your fields or method signatures during the classloading. It might not be direct, it could be referencing one of your other classes that needs to load ClientLevel. Obviously, ClientLevel doesn't exist on the server so it crashes. The usual way to solve this is to move the field or method to a different class that only gets referenced/loaded from inside your client method.
-
[1.18.2] How to get the server address of the server the player is connected to?
There is no such event on the client side. See this old discussion: https://forums.minecraftforge.net/topic/66022-playereventplayerloggedinevent-doesnt-work/ for a workaround. Basically you can detect when a player enters a dimension.
-
Minecraft crashes saying Error: java.lang.IllegalStateException: Render layers can only be set during client loading!
You need forge 42 or before.
-
Crashed while rendering overlay
https://forums.minecraftforge.net/topic/113073-minecraft-crashes-saying-error-javalangillegalstateexception-render-layers-can-only-be-set-during-client-loading/ at the bottom.
-
Crashed while rendering overlay
https://forums.minecraftforge.net/topic/113073-minecraft-crashes-saying-error-javalangillegalstateexception-render-layers-can-only-be-set-during-client-loading/ at the bottom.
-
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
You probably want to read this? https://github.com/thedarkcolour/KotlinForForge/blob/1.x/README.md
-
Valhelsia 3 server doesn't start
minecraft 1.16.5 needs java 8 not java 17
IPS spam blocked by CleanTalk.