-
Posts
1773 -
Joined
-
Last visited
-
Days Won
61
Everything posted by V0idWa1k3r
-
You can use AnvilRepairEvent to control the chance of the anvil damaging when it is used to repair/combine items.
-
MobEffects.LEVITATION
-
[1.12.2] Spawning an entity resulting in a crash
V0idWa1k3r replied to abused_master's topic in Modder Support
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. -
You cannot blindly assume that any entity hit by your projectile is a subclass of EntityLivingBase. Use instanceof before casting.
-
[1.12.2] @SubscribeEvent seems to be not working as it in 1.7.10 did
V0idWa1k3r replied to nocot's topic in Modder Support
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 -
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.
-
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.
-
[Solved] java.lang.ExceptionInInitializerError
V0idWa1k3r replied to Venrob's topic in Modder Support
Use another super constructor call in your ToolAxe constructor. The one that takes a ToolMaterial, float, float. -
Explosion spawning based on the rotation?
V0idWa1k3r replied to Oscarita25's topic in Modder Support
The last parameter of World#createExplosion is a boolean controlling whether the explosion damages terrain. -
Explosion spawning based on the rotation?
V0idWa1k3r replied to Oscarita25's topic in Modder Support
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. -
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.
-
Explosion spawning based on the rotation?
V0idWa1k3r replied to Oscarita25's topic in Modder Support
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. -
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.
-
Your model's parent model is block/block yet you've specified the textures for block/orientable. Edit: well I'm slow
-
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.
-
Explosion spawning based on the rotation?
V0idWa1k3r replied to Oscarita25's topic in Modder Support
Detect the key press client-side then send a packet to the server and spawn the explosion. -
Explosion spawning based on the rotation?
V0idWa1k3r replied to Oscarita25's topic in Modder Support
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. -
You must return an object that extends GuiScreen in your GuiHandler#getClientGuiElement. You are returning a Container.
-
[1.12.2] Recommanded way of accessing the mods folder?
V0idWa1k3r replied to Kinniken's topic in Modder Support
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. -
[1.12.2] Recommanded way of accessing the mods folder?
V0idWa1k3r replied to Kinniken's topic in Modder Support
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. -
[1.11.2] How to tell if player has a potion effect.
V0idWa1k3r replied to K3YD0N's topic in Modder Support
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. -
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)
-
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.
-
It's still GameRegistry#registerTileEntity. Use the overload which takes a ResourceLocation as the second argument though.
-
The field is public. just bind Then use the UVs from the TextureAtlasSprite when making vertices with the BufferBuilder.