Posts posted by Choonster
-
-
-
It seems that IRecipe#getRemainingItems was only added in 1.8.
I'm not sure it's possible to do this with vanilla items in 1.7.10. For your own items, you can use the container item system to damage the item with each craft. I have an example of this here.
-
To use ore dictionary ingredients, you need to create a ShapedOreRecipe or ShapelessOreRecipe and add it with GameRegistry.addRecipe.
To make a recipe that damages an axe, you need to create your own recipe class. I wrote a class here that does exactly that (I add an instance of it here). This doesn't support ore dictionary ingredients, but you could adapt it to extend ShapelessOreRecipe instead of ShapelessRecipes.
-
Do you want to add buildings to existing villages or create your own villages from scratch?
If it's the former, I explain how to do that briefly here.
If it's the latter, you may be able to use FML's IWorldGenerator as a wrapper for your MapGenStructure class (since MapGenStructure sets blocks in the World directly rather than using the Block array like other MapGen classes).
-
Do you have a blockstates file for the new block?
Try following The Grey Ghost's blog post on troubleshooting model errors.
-
If you look at the usages of CreativeTabs#getBackgroundImageName, you'll see that it's only used on this line of GuiContainerCreative:
this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.getBackgroundImageName()));
So your texture needs to be in assets/minecraft/textures/gui/container/creative_inventory/tab_<name> rather than your mod's regular assets folder.
-
LivingAttackEvent would indeed be a better choice for this. For some reason I thought it was fired when a living entity attacked something rather than when a living entity is attacked by something.
You should be able to use e.source.getSourceOfDamage() to get the attacking Entity (like your original code), Entity#attackEntityFrom to attack the mob and Event#cancel to cancel the event (preventing the damage to the entity with the potion effect).
instanceof will simply return false if used with a null value, so you don't need to explicitly check for null before using it.
-
Edited by Choonster
Fixed broken links.You don't need to include water in your model, just set the block's Material to water and add the BlockLiquid.LEVEL property to your BlockState with a default value of 15. You'll also need to register a custom StateMapper to ignore this property when looking for the model.
-
-
LivingUpdateEvent doesn't have a DamageSource source field (because it's not at all related to an Entity taking damage).
You shouldn't need to manually remove the PotionEffect when it runs out, EntityLivingBase will do that automatically.
If you want to react to and cancel damage received by an EntityLivingBase, subscribe to LivingHurtEvent instead.
-
public static Item item; @EventHandler public void preInit(FMLInitializationEvent event) { item = new CItem().setUnlocalizedName("test").setCreativeTab(CreativeTabs.tabBlock); GameRegistry.registerItem(item, "test"); } @EventHandler public void init(FMLInitializationEvent event) { if(event.getSide() == Side.CLIENT) Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation("test:test")); }
still not working
Your preInit method has FMLInitializationEvent as its parameter instead of FMLPreInitializationEvent. This means it's still being called during init instead of preInit.
-
How to make it so you have creative mode flight if you right click an item.
in Modder Support
Override Item#onItemRightClick to toggle the EntityPlayer's flight ability using the fields I described in my original post.
You'll probably want to do this on the server and call EntityPlayer#sendPlayerAbilities to sync it with the client (I haven't tried to implement this, so I'm not entirely sure).