-
Posts
422 -
Joined
-
Last visited
-
Days Won
1
Posts posted by Novârch
-
-
1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
-
LivingEntity#removePotionEffect(Effect)Edit: Oof, thought you meant a potion effect, I should really take my time and read these in detail.
-
First of all, don't reference FMLJavaModLoadingContext directly from that class, put it as a parameter in the PotionRegistryHandler#init method, second of all, you never even register your potions by calling EFFECTS#register, and lastly, your DeferredRegisters have their names mixed up, the first one is for effects and the second one is for potions.
-
You need an interface to make a capability, I'd say you should call it IPet, Pet should implement it and you should pass in IPet in @CapabilityInject and the first parameter of register. The interface should look something like this with what you're currently doing:
public interface IExample { EntityType<?> getEntityType(); void setEntityType(EntityType<?> type); }
I strongly recommend you use generics instead if you can, something like this:
public interface IExample { <T extends Entity> EntityType<T> getEntityType(); <T extends Entity> void setEntityType(EntityType<T> type); }
Ping me or something next post, I'll help you out if I can.
Edit: Oh come on, solved as I was posting.
-
13 hours ago, VaalAlves said:
If possible, could you please show me an example of a working ToolItem?
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.OAK_PLANKS, Blocks.SPRUCE_PLANKS, Blocks.BIRCH_PLANKS)
Pretty much the same as in AxeItem, edited some stuff to avoid breaching Mojang's copyright. Remember that you need a class that extends ToolItem (at least in 1.15, but I don't think that changed in 1.16).
- 1
-
11 minutes ago, coderboy_yt said:
Is there any way to move a mod from older edition of Minecraft Forge to a newer one?
Of course there is, change some version numbers in your mods.toml and build.gradle and voila, you're on 1.16, it's pretty obvious which ones you should change, but if you aren't sure I recommend setting up a 1.16 project from the MDK and copying it from that. On a separate note, I personally recommend you stay away from 1.16 Forge until it gets a recommended release.
-
4 minutes ago, VaalAlves said:
Here but i'm not sure how.
It's just a parameter, pass it in, but you can't directly reference the one in AxeItem as it's private, if you really don't want to copy it,
1 hour ago, Novârch said:if you're super paranoid like me, use some reflection or AT's to get direct access to the field so you don't have to copy Mojang's code.
-
Pretty easy, actually. You've got the random generation down, don't change it, as for the PlayerEntity#dropItem method requiring an ItemStack, if you took literally 1 second to look at ItemStack, you'd see that it has a constructor that takes in an Item.
19 minutes ago, Darkrider000 said:ps. my reference also 1.12.2 version so I encounter lot of problem even if try to copy it as well
If you can solve a crossword puzzle, you can translate 1.12 item code to 1.15, barely anything had changed (excluding metadata, of course).
-
On 7/2/2019 at 9:28 AM, diesieben07 said:
Currently there is indeed no client command handling in Forge, since vanilla's command handling was completely rewritten.
As for tab completion... you would need a custom solution there as well, since vanilla's tab completion handling is very intertwined with the command system.
Seems client commands are currently impossible.
Edit: What about a keybind, I think you could use that.
-
3 minutes ago, VaalAlves said:
And how would i make the blocks drop items only if they're broken with said custom tool type?
You could copy the EFFECTIVE_ON field from AxeItem, ShovelItem or PickaxeItem and pass it into the ToolType constructor, or if you're super paranoid like me, use some reflection or AT's to get direct access to the field so you don't have to copy Mojang's code.
-
Just now, Blu3 said:
Thx, now I need to open this gui with command, but I will publish another topic for that.
Neat, I'll try to help you with that one, Brigadier command syntax is incredible.
-
1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
-
4 minutes ago, Agreenstopsign said:
I have looked quite a bit.. and I have also tested 0 and 1, and it just creates the item stack in my hotbar slots 0 and 1
I'm gonna take a wild guess and say you're calling the method on the player, I can't be certain without seeing your code.
-
1 hour ago, Agreenstopsign said:
yes I know that, however, replaceItemInInventory asks or a number (which represents the slot), and then the itemstack,
I do not know what the number for a horses saddle/horse armor slot isWell look through the code and find out, it has to be somewhere, my guess is 0 for the saddle and 1 for the armor.
-
4 minutes ago, Same here said:
Maybe there's something wrong with my statement,I've learned the basics of Java.My mod has written a lot of basic items and blocks.In fact ,I know that the alchemy bag stores item data through the player entity.But I want to konw how to make the custom capability which can stores itemstack.I've learned how to extend the player's attribute data through the NBT tag.But the NBT Tag ,but NBT data can only store data types.How can I store the itemstack to the playerentity?
This is just from a first glance, so take it with a grain of salt, EE3 seems to write the player's UUID to the ItemStack-s NBT, this is very hard to follow because of the mods' heavy use of util classes, but can be deciphered with some time, I'll give you the link to the item on GitHub, beware it's for 1.12 though, but I think NBT hasn't really changed since day 1.
-
13 minutes ago, Same here said:
I want to ask how to make a item which like AlchemicaBag in EE2?
Make your own thread if you want help.
13 minutes ago, Same here said:I can't understande the source code in the github
If you can't understand the source it's very unlikely you can actually make it yourself, if you want to make a mod, learn Java, get acquainted with Forge and Minecraft, and then do what you want, asking for help when you don't understand Forge/Java will get you nowhere long-term.
-
1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
-
1 minute ago, Blu3 said:
public void func_1737_v_as(Matrix mouseY)
1.16 is still in Beta and doesn't have real mappings ready yet, the current mappings are handmade, I honestly recommend you don't use 1.16 yet, but if you really want to you could fire up a Forge 1.15 project and look at the classes there, they're basically the same.
-
3 minutes ago, scrouthtv said:
That's the reason I asked
That method cannot be what you're looking for, it's static and you can't override static methods, look for another method.
-
2 hours ago, Blu3 said:
But I didn't found any tutorial about custom gui.
You don't need a tutorial to do something, take a look at the vanilla code, I believe it's all in
net.minecraft.client.gui
-
5 hours ago, Zeher_Monkey said:
I'm severely confused as this is a basic in Java???
You're trying to override a static method, you can't do that, and it doesn't even make sense.
-
8 minutes ago, scrouthtv said:
But how do override it?
You cannot override static methods, that is basic Java, it doesn't make any sense.
-
Remove ModMusicDiscItem and instantiate MusicDiscItem directly, your issue most likely comes from the fact you are using the deprecated method that takes in a SoundEvent, use the one that uses a Supplier<SoundEvent>.
-
Versions 1.12 and below are no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
i get this error while i try to load mekanism mod
in Support & Bug Reports
Posted
You don't.