Jump to content
  • Home
  • Files
  • Docs
Status Updates
  • All Content

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • vemerion

vemerion

Members
 View Profile  See their activity
  • Content Count

    220
  • Joined

    July 6, 2020
  • Last visited

    5 hours ago
  • Days Won

    6

vemerion last won the day on November 17 2020

vemerion had the most liked content!

Community Reputation

56 Excellent

2 Followers

  • BlockyPenguin

About vemerion

  • Rank
    Creeper Killer

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. vemerion

    (1.16.2) Inside a new capability

    vemerion replied to e2rifia's topic in Modder Support

    You are right. I opted for the easy and wrong answer, and then tried to explain it away. I have updated my original answer, and I hope you can find it in your heart to forgive me! What you should do is change the type of your instance field to the type LazyOptional<IState>, which you should initialize to LazyOptional.of(() -> STATE_CAPABILITY.getDefaultInstance()), to avoid creating a new LazyOptional every time getCapability() is called. Note that you might have to slightly change some of your other methods to accommodate for the fact that instance now is a LazyOptional. Here is another thread which also discusses why you should cache the capability. I would also recommend taking a look at the LazyOptional class (easiest done via your IDE), since it includes a lot of documentation about why/how it is used.
    • Friday at 10:19 AM
    • 7 replies
      • 1
      • Like
  2. vemerion

    (1.16.2) Inside a new capability

    vemerion replied to e2rifia's topic in Modder Support

    Of course you are right! However I wanted to provide a as simple solution as possible, which is why I left out that part.
    • Friday at 08:58 AM
    • 7 replies
  3. vemerion

    (1.16.2) Inside a new capability

    vemerion replied to e2rifia's topic in Modder Support

    I usually do it like this: return STATE_CAPABILITY.orEmpty(capability, LazyOptional.of(() -> instance)); EDIT: This is the simple but very wrong answer! As diesieben07 points out further down in the thread, you should absolutely cache the LazyOptional in a field to avoid creating a new LazyOptional every time getCapability() is called.
    • Friday at 08:33 AM
    • 7 replies
      • 1
      • Like
  4. vemerion

    [1.16] Attach Capability to Chunks?

    vemerion replied to kiou.23's topic in Modder Support

    You don't need an interface, you could use the ChunkValue class only, without an interface.
    • December 1, 2020
    • 11 replies
      • 1
      • Thanks
  5. vemerion

    How do i change drops for leaves

    vemerion replied to zied66's topic in ForgeGradle

    I recommend looking into the Global loot modifiers system.
    • November 30, 2020
    • 2 replies
  6. vemerion

    Making a pumpkin like overlay (1.16.4)

    vemerion replied to Grandlovania's topic in Modder Support

    If it is your own custom item, you could use the renderHelmetOverlay() method instead of an event.
    • November 28, 2020
    • 6 replies
  7. vemerion

    How do I add custom trades to the Wandering Trader?

    vemerion replied to Moomallowz's topic in Modder Support

    What exactly are you having trouble with? This line of code: event.getGenericTrades().add(new BasicTrade(5, new ItemStack(Items.ENCHANTED_GOLDEN_APPLE, 5), 2, 10)); would add a new trade that costs 5 emeralds and gives you 5 enchanted golden apples in return.
    • November 24, 2020
    • 26 replies
      • 1
      • Like
  8. vemerion

    Where the enchantment tooltips are displayed

    vemerion replied to Zemelua's topic in Modder Support

    Do you mean that you want to know where the vanilla code is for creating the enchantment tooltips? If so, it is in the getTooltip() and the addEnchantmentTooltips() methods in the ItemStack class. If you want to add your own custom tooltip to an item, you can do so via the addInformation() method in the Item class if it is for your own custom item, or via the ItemTooltipEvent event if it is for a vanilla item.
    • November 23, 2020
    • 1 reply
  9. vemerion

    How do I add custom trades to the Wandering Trader?

    vemerion replied to Moomallowz's topic in Modder Support

    Call the WandererTradesEvent event and add your own custom ITrades to the list in the event.
    • November 23, 2020
    • 26 replies
      • 2
      • Like
  10. vemerion

    Add my own DataParameter to the player

    vemerion replied to Zemelua's topic in Modder Support

    You can't really add new dataparamaters to vanilla entities. You should instead use capabilities.
    • November 22, 2020
    • 1 reply
  11. vemerion

    Recipes Dont Work

    vemerion replied to PutoPug's topic in Modder Support

    It looks like you spelled 'stick' wrong in the recipes.
    • November 21, 2020
    • 3 replies
  12. vemerion

    [1.15.2] Teleport Player to Nearest "Safe" Spot

    vemerion replied to ModMCdl's topic in Modder Support

    If you look at the call hierarchy of the placeEntity() method, you can see that the entity it returns is in fact the entity that is teleported. Therefore, to change the position of the entity you would only need to change the position of the entity you return before returning it.
    • November 19, 2020
    • 15 replies
  13. vemerion

    [1.15.2] Teleport Player to Nearest "Safe" Spot

    vemerion replied to ModMCdl's topic in Modder Support

    I think the method makePortal() in the Teleporter class is where vanilla tries to find a nearby valid position to create the portal in. However, it is kind of a large and unreadable method, so I don't know if it is realistic to try and replicate it. Another possibility would be to do something similar to how the locate command works. I am not too familiar with world generation, but if your islands are generated similar to how vanilla structures are generated, then this could work.
    • November 18, 2020
    • 15 replies
  14. vemerion

    Biome Gen

    vemerion replied to Intijir's topic in Modder Support

    I don't think there is a direct equivalent of CountRangeConfig, see this thread for more details.
    • November 18, 2020
    • 1 reply
  15. vemerion

    Closing a Container when Dropping an Item

    vemerion replied to pacguy's topic in Modder Support

    Here is what I would do: override the canInteractWith() method in your custom container, and return false if the player is no longer holding your storage item.
    • November 17, 2020
    • 1 reply
      • 1
      • Like
  • All Activity
  • Home
  • vemerion
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community