Jump to content

Choonster

Moderators
  • Posts

    5172
  • Joined

  • Last visited

  • Days Won

    78

Everything posted by Choonster

  1. Do you have a blockstates file for the new block? Try following The Grey Ghost's blog post on troubleshooting model errors.
  2. 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.
  3. 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.
  4. 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. You can see how BoP does this here and how I do it here.
  5. In your blockstates file you have "particle": "blocks/wool_colored_light_blue", this is wrong because Minecraft expects each value in the "variants" object to be an array or an object but you've used a string. Particles are only defined in models anyway, so you should delete the line entirely.
  6. 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.
  7. Your preInit method has FMLInitializationEvent as its parameter instead of FMLPreInitializationEvent. This means it's still being called during init instead of preInit.
  8. You can replace vanilla's block models with a resource pack.
×
×
  • Create New...

Important Information

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