-
Posts
687 -
Joined
-
Last visited
-
Days Won
10
Everything posted by Beethoven92
-
[1.16.3] How to create armor piece with IForgeItem?
Beethoven92 replied to ThatGuyDavid's topic in Modder Support
I am not really sure that i got what your question right but IArmorMaterial is just used to get material specific stats for your armor pieces..this is unrelated to IForgeItem. When you create your custom armor piece item you create a new ArmorItem, which extends Item, which extends IForgeItem. Then in the constructor of your ArmorItem you pass an armor material. What are you trying to do exactly? -
Which class handles the rendering of a tooltip?
Beethoven92 replied to Tavi007's topic in Modder Support
It is correct yes, just don't subscribe to that event. Use the RenderGameOverlayEvent.Pre or Post. Take a look at the IngameGui class to see how vanilla draws hotbar, health and hunger bars etc... -
Take a look at the EntityRenderer#renderName method...to draw an image instead of text you could just use a textured quad
-
I am not experiencing any weird ghost block issue after trying to execute your code...can you show the rest of your code please?
-
Take a look at flags usage in World#setBlockState function...the Block.replaceBlock function uses flags the same way. Also you can subscribe to the UseHoeEvent instead of the RIghtClickBlock event
-
Mmmm so you are basically re making ElectroBlob's wizardry...really there are so many magic mods around that you cannot event count them..why not taking a look at their code to see how they implement wands, spells etc...Electroblob's wizardry is an open source mod, so it would be a good place to start gathering informations
-
[1.15.2] Nerf/Change vanilla ore Generation
Beethoven92 replied to jmb19905's topic in Modder Support
You have to loop through every biome and remove the feature that is responsible for ore generation. As i said, take a look at the classes i suggested and also take a look at this post, which exactly matches your problem: https://forums.minecraftforge.net/topic/89281-solved-115x-disable-vanilla-ore-gen-or-change-the-fillerblocktype/?tab=comments#comment-415925 -
[1.15.2] Nerf/Change vanilla ore Generation
Beethoven92 replied to jmb19905's topic in Modder Support
Yes, you need to remove the feature that generates the iron ore from every biome in the game. This is because every biome register its own set of features, and all of the biomes have the basic ore generation feature registered. So after removing ore generation from every biome you need to loop through them again and add the ore feature with your custom generation parameters. I suggest you to look into some vanilla biome classes to get an idea how features are added. Also in the DefaultBiomeFeatures class you can find many informations, such as the parameters used by vanilla for ore generation (vein sizes, max and min height etc...), and you can also see how to create features. -
[1.16.1] Creating custom storage blocks
Beethoven92 replied to TheOnlyTails's topic in Modder Support
Make sure the name and location of your model files match those you specified in your blockstate json, and the name and location of your texture files match those specified inside the model jsons -
[1.15.2] How do I make entity swim and breath underwater?
Beethoven92 replied to LeiteDesnatado's topic in Modder Support
You have to override canBreatheUnderwater and make it return true always. Anyway if you are making a fish like entity, why not taking a look at how vanilla implements water mobs? You can find useful information in the classes: AbstractFishEntity, WaterMobEntity and GuardianEntity -
[1.16.1] Creating custom storage blocks
Beethoven92 replied to TheOnlyTails's topic in Modder Support
In your model files you are telling your models to search for the specified textures within the minecraft namespace, which of course fails because the textures are your custom ones. You have to replace "minecraft" with your modid in your "top", "bottom" and "side" textures locations -
Show your tile entity class please...also, to get an object from a registry object you need to use get().. ModBlocks.QUARRY won't work because you are not getting the Block itself, you are getting a RegistryObject<Block>
-
Lightning fast response, thank you sir
-
This is the first time i try to mess with minecraft chunk loading, and i'd just like to get a little feedback on this problem (not asking for code examples ๐). I am implementing an entity that can spawn anywhere in the world (maybe in a certain radius around the player), it will have a relatively short life span and a fixed direction vector. However i need it to always be processed, from when it spawns to when it leaves the world, no matter where the player is relatively to the entity. Also the entity can interact with the world, destroying the blocks it finds in its path until it reaches its destination and damaging living entities it collides with. After diving a bit into the code that manages chunks the first and simpler solution that came to my mind was simply to force load the chunk the entity is in and the next chunk it will traverse based on its direction (to avoid the entity entering an unloaded chunk and thus stop being updated). Then when the entity dies i just force unload only the chunks that were loaded by the entity, because there may be chunks that were already loaded by something else for whatever reason. The chunk loading and storing should be implemented in the form of a world capability i guess, and internally would just replicate what the /forceload command does. So the question is: would this be the the best or most efficient way to achieve something like that? And is there something else i should take into account to not create issues when force loading/unloading chunks?
-
For sure it is possible to do this, and in fact it has already been done. However it is not really a simple thing to achieve, specially if you are new to modding..you may want to take a look at the MIneColonies mod, which implements npcs that literally do what you want, and start exploring the vanilla code that handles villager entities
- 1 reply
-
- 1
-
Well, you could start by showing us some of the code you tried.. Also, to start with the example you provided: You see that there is a minecraft entity that has a behaviour very similar to what you need, and its the turtle entity. It has a home position which it remembers always, no matter how far the turtle goes, and will return to that position to lay eggs. Take a look at the code for the turtle entity and see if you can adapt it to your whale entity
-
Don't subscribe to this event: RenderGameOverlayEvent subscribe to the RenderGameOverlayEvent.Post event
-
You need to use a Supplier<ItemStack>...this way you avoid a direct call to an object that has not been registered yet. Then your createIcon method would need to return iconSupplier.get()..where iconSupplier is whatever name you will give to the supplier
-
[SOLVED] How do I send a simple chatmessage to the client only?
Beethoven92 replied to Philip2809's topic in Modder Support
He means that when sending a message that is not coming from a player, there is no need to pass the player UUID...that is where the dummy UUID should be used -
[SOLVED] How do I send a simple chatmessage to the client only?
Beethoven92 replied to Philip2809's topic in Modder Support
One of them...who? -
[SOLVED] How do I send a simple chatmessage to the client only?
Beethoven92 replied to Philip2809's topic in Modder Support
Yes, it is -
[1.15.2] world.getEntitiesWithinAABB locks world generation
Beethoven92 replied to Luminaire's topic in Modder Support
Is your event listener actually getting called? It seems that you did not register your event handler on the event bus -
[SOLVED] How do I send a simple chatmessage to the client only?
Beethoven92 replied to Philip2809's topic in Modder Support
Use the dot to call methods or fields of a class