Jump to content

V0idWa1k3r

Members
  • Posts

    1773
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by V0idWa1k3r

  1. You can use AnvilRepairEvent to control the chance of the anvil damaging when it is used to repair/combine items.
  2. MobEffects.LEVITATION
  3. You are overriding Entity#entityInit to do nothing. entityInit is responsible for registering keys into the data manager of the entity. In your implementation no keys are being registered so when the game tries to set the health for the mob it crashes because health is managed via datamanager.
  4. You cannot blindly assume that any entity hit by your projectile is a subclass of EntityLivingBase. Use instanceof before casting.
  5. If you are registering a class object to the event bus your event handers must be static. To have non-static handlers working register an instance of your class to the bus. https://mcforge.readthedocs.io/en/latest/events/intro/#static-event-handlers
  6. This is based on your resources pack format. If you have a pack.mcmeta file that specifies the pack_format as 3 then all resource names MUST be lowercase including the lang file. If you are using format 2(happens if you do not specify the format at all then forge will use LegacyV2Adapter) then lang files must be as en_US.
  7. You are getting your ItemBlock instance from a fresh instance of Block but you should be getting it from the actual block that is already registered. Your ItemBlock instance points to an unregistered instance of a Block. I do not know if this is a source of your problem but it is still a big issue. To be clear public static final Block[] MOD_BLOCKS = new Block[] { new UraniumBlock() }; public static final String MOD_ID = "blueshades"; public static final Item[] MOD_ITEM_BLOCKS = new ItemBlock[] { new UraniumBlock().toItemBlock() }; You have 2 different instances of UraniumBlock here, only one of which gets registered and it's not the one your ItemBlock referres to.
  8. Use another super constructor call in your ToolAxe constructor. The one that takes a ToolMaterial, float, float.
  9. The last parameter of World#createExplosion is a boolean controlling whether the explosion damages terrain.
  10. You do not need to cast a float to a float. Why is your networkwrapper in your proxy? And this looks like a Code-style Issue #1 to me. I think that your issue is here. Explosions with a very low power value will not damage entities.
  11. Wrong subforum. Banners use vanilla's hacky TE based rendering. They are not rendered as other items are so they are not something you can base your rendering on. You have 2 options: Use forge's blockstates with sub-models. Using sub-models you can just define 16*3 variants instead of 163. Use custom BakedModels with a custom ICustomModelLoader. I think this is what Tinkers does.
  12. Why are you using lastTickPos insread of pos? As long as you pass your actions to a server thread this is the correct way to do this. Show more of your code preferrably as a git repository so I can debug it myself.
  13. To specify a model based on NBT data look at vanilla's ItemBow and it's model. While it doesn't use NBT data you can easily adapt the code there to use NBT. By the error in your log it looks like vanilla json can't have a non-vanilla obj(provided by forge) as it's parent.
  14. Your model's parent model is block/block yet you've specified the textures for block/orientable. Edit: well I'm slow
  15. This happens because you extended BlockContainer which overrides Block#getRenderType to return INVISIBLE. Either do not extend BlockContainer and override Block#hasTileEntity and Block#createTileEntity or override Block#getRenderType and return EnumBlockRenderType.MODEL.
  16. Detect the key press client-side then send a packet to the server and spawn the explosion.
  17. Yaw and pitch are angles for rotation. Use Entity#getLookVec to get the vector of where the player is looking to then rotate and translate it until you get the desired result.
  18. You must return an object that extends GuiScreen in your GuiHandler#getClientGuiElement. You are returning a Container.
  19. Loader#getConfigDir is the way I load json settings from a folder in the config directory in my mod. I do not have to use anything else so I assume you will not have to either.
  20. You can use Loader#getConfigDir to get the configuration directory then step a directory higher and enter the mods directory since both config and mods directories are located within the same directory. You could also use reflection to access Loader.canonicalModsDir. There might be a better way that I am unaware of though.
  21. EntityLivingBase#isPotionActive is the method that checks is the specified potion active for the entity. It takes a Potion argument and you can get the potion instances from the MobEffects class. Your current code doesnt't work because it contains syntax errors.
  22. Use IGuiHandler with EntityPlayer#openGui(Object mod, int modGuiId, World world, int x, int y, int z) for your custom GUIs. Your solution will open a gui/container pair of a vanilla furnace which is likely not what you want. If you do want that you can Still use IGuiHandler. Just return vanilla's ContainerFurnace and GuiFurnace in corresponding methods. Make sure that your TE implements IInteractionObject. I do not see Override annotations in your code(Code-style issue #2)
  23. If there are no overloads then you are using a forge version which doesn't have that introduced. In the newer version GameRegistry#registerTileEntity(Class<? extends TileEntity> tileEntityClass, String key) is deprecated with a comment that it'll be removed in 1.13.
  24. It's still GameRegistry#registerTileEntity. Use the overload which takes a ResourceLocation as the second argument though.
  25. The field is public. just bind Then use the UVs from the TextureAtlasSprite when making vertices with the BufferBuilder.
×
×
  • Create New...

Important Information

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