Jump to content

Beethoven92

Members
  • Posts

    687
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by Beethoven92

  1. 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?
  2. 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...
  3. Take a look at the EntityRenderer#renderName method...to draw an image instead of text you could just use a textured quad
  4. I am not experiencing any weird ghost block issue after trying to execute your code...can you show the rest of your code please?
  5. 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
  6. 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
  7. That's because you posted literally 1 second later ๐Ÿ˜„
  8. I confirm what i said in my previous answer post that...apparently disappeared...the problem is that there are invalid characters in your item's registry name, see? Exception message: net.minecraft.util.ResourceLocationException: Non [a-z0-9/._-] character in path of location: examplemod:Ruby
  9. 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
  10. 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.
  11. 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
  12. 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
  13. 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
  14. 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>
  15. Lightning fast response, thank you sir
  16. 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?
  17. 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
  18. 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
  19. Don't subscribe to this event: RenderGameOverlayEvent subscribe to the RenderGameOverlayEvent.Post event
  20. 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
  21. 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
  22. Is your event listener actually getting called? It seems that you did not register your event handler on the event bus
  23. Use the dot to call methods or fields of a class
×
×
  • Create New...

Important Information

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