-
Posts
42 -
Joined
-
Last visited
-
Days Won
1
Everything posted by SaltStation
-
[1.15.2] Items and blocks don't register correctly
SaltStation replied to SaltStation's topic in Modder Support
Ah ok it works now, but why shouldn't I use the ItemfromBlock method? -
[1.15.2] Items and blocks don't register correctly
SaltStation replied to SaltStation's topic in Modder Support
Yes it is this class: public static BlockItem ItemfromBlock(Block p) { return (BlockItem) new BlockItem(p, (new Item.Properties()).group(ItemGroup.BUILDING_BLOCKS)).setRegistryName(p.getRegistryName()); } } -
[1.15.2] Items and blocks don't register correctly
SaltStation replied to SaltStation's topic in Modder Support
Because all three blocks are the same except in name I made the following class: -
I wanted to try the DeferredRegister to register items and blocks, but I always get this error: RegistryHandler code : Main mod class: There are blocks with the same name as items, but this should be fine shouldn't it? How does this error happen and how would I fix it? Thanks in advance!
-
I want to generate ore only next to underground lava lakes, but I don't know how. I have come up with two approaches so far. When a lava lake is generated the ore is placed on nearby stone. The game generates the ore like normal, but checks if lava is nearby before placing the ore. Which approach is the better or is there a different way to do this?
-
[1.12.2] How to get a player from UUID if the player is offline
SaltStation replied to SaltStation's topic in Modder Support
Thanks it works. -
[1.13.2] How to check right click on the block by item in mainhand?
SaltStation replied to Tameet's topic in Modder Support
Can you be more specific? -
For a custom capability you need to have an Interface, Default implementation, Storage, Provider and a Factory. If you want to attach the capability to a player you will need to use an attachcapability event and register it in your main mod class. If your Player is teleported or respawns you will also have to manage your capability so you dont lose data. Here is an example: https://github.com/SALTStation/mod/tree/master/src/main/java/com/SaltStation/Main/Capabilities/FatigueCapability https://github.com/SALTStation/mod/blob/master/src/main/java/com/SaltStation/Main/handlers/events/CapabilityHandeler.java Ignore wrong grammar...
-
Hello everyone, I want to get an EntityPlayerMP object by using a UUID but my current method only works if the player in question is online. Is there a way to get a list of all Players who where on the server at some point? Current Method: I want to get the statistcmanagerserver from the player by the way.
-
Youtube tutorials are usually not reliable as many creators take shortcuts which are not very appreciated on this Forum. An amazing source for information in addition to the ones named by GloriousAlpaca are Minecraft classes and methods themselves and other mods which have an open Github. I think key bindings are saved in the options.txt which you could edit. I would not recommend changing the default Ui as changing minecraft code may make other mods incompatible. Opening a second inventory or a second hotbar is possible by drawing a ui for the hotbar and having a custom container and gui for the inventory. If you want to save data to the player you need to make your own capability which you attach to the player.
-
I think you need to have a TileEntity and use IFluidHandler. If the amount of fluid changes you can instruct the TileEntity to change the blockstate of the cauldron.
-
Hello everyone. After the player uses a Gui a value in the NBT of the held item is supposed to change, but the hand always returns null. EnumHand hand = mc.player.getActiveHand(); mc.player.getHeldItem(hand).getTagCompound().setString("spell","test");
-
Working as intended!
-
I just hold rightclick in this video. The upload here failed so here is a link to google drive: https://drive.google.com/open?id=1Xfw6LoKfH6m_OqXlkFFqhSyXxR-KoHpT Code:
-
I copied the methods from the ItemBow class, but the animation is kind of not working. You can see the item twitching in first person, but no animation from any other perspective. Am I missing something?
-
How do I make an Item use an animation from a minecraft item like a bow for example?
-
Hello everyone. The problem I have is that every time I try accessing my capability I get a null pointer exception. Do I have to send packets to the client at the start of the game to prevent this? Because I thought you only need packets to update information. Default Implementation: Storage: Provider: Capability Handler: Other Handler: Common Proxy:
-
[1.12.2] Problem with capability registration
SaltStation replied to SaltStation's topic in Modder Support
Nevermind found the solution -
Hello everyone. I am trying to register my capability in my common proxy but my compiler can not resolve "register" CapabilityManager.INSTANCE.register(IFatigue.class, new FatigueStorage(), Fatigue.class);
-
Is there an easy way to make an item replace itself in the players hand with another item? Thanks in advance.
-
Hello everyone. I made an item which changes its durabilitybar and enchantment glint depending on how often you rightclick. Every instance of this item now has the same glint and durabilitybar even if their value is different on the server. I think this is because I saved the values for the glint and durabilitybar method in my item class. Because my NBTTagcompund is stuck in onItemRightClick. What is the proper way of saving these values for every instance of my item? Thanks in advance.
-
[Solved][1.12.2] Custom Particle Texture problem
SaltStation replied to SaltStation's topic in Modder Support
It seems to work just fine now, thank you for your help.