Jump to content

SaltStation

Members
  • Posts

    42
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by SaltStation

  1. Ah ok it works now, but why shouldn't I use the ItemfromBlock method?
  2. 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()); } }
  3. Because all three blocks are the same except in name I made the following class:
  4. 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!
  5. 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?
  6. Just override the getDrops method and add the item to the drops Itemstack.
  7. 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...
  8. 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.
  9. 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.
  10. 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.
  11. 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");
  12. 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:
  13. 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?
  14. How do I make an Item use an animation from a minecraft item like a bow for example?
  15. No you only have one item but depending on the parameters it can have different damage/effects/whateveryouwant Sword(String name, int material, String infusion) in your ModItem class: FIRESWORD_LEVEL_TWO = new Sword(firesword_level_two,2, fire)
  16. You could add additional parameters to the constructor of your sword class.
  17. 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:
  18. 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);
  19. Is there an easy way to make an item replace itself in the players hand with another item? Thanks in advance.
  20. 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.
  21. It seems to work just fine now, thank you for your help.
×
×
  • Create New...

Important Information

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