Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/10/22 in all areas

  1. "Cannot invoke "net.minecraft.nbt.CompoundNBT.getDouble(String)" because "nbt" is null" Ah yes, plain English. Think I'm running low on "net.minecraft.nbt.CompoundNBT.getDouble(String)", better run to the store and get some.
    1 point
  2. In general it is not possible. If you want to try, e.g. if you just want ores that are placed using the vanilla ore feature you can get the placed features from the server registry @Mod.EventBusSubscriber(modid = MODID) public class OreTest { @SubscribeEvent public static void serverStarting(ServerStartingEvent event) { var placedFeatures = event.getServer().registryAccess().registryOrThrow(Registry.PLACED_FEATURE_REGISTRY); placedFeatures.forEach(placed -> { if (placed.feature().value().config() instanceof OreConfiguration) LOGGER.info(placed.toString()); }); } } That misses if/how many biomes use that feature. You would need to check each Biome's BiomeGenerationSettings to find that out. Then of course you have the issue of whether the biome is used. 🙂 But that's not the hard part. You have to parse the PlacementModifiers. Which are opaque. You can try to parse the known vanilla ones. So, you can work out how to do the above if it is for vanilla (and maybe even known modded ones) but you can't for all mods. Which is why it isn't really possible. I have heard of people in the past doing some kind of monte carlo simulation where you generate chunks in a dummy world in the background to see how many of each ore was placed. I can't remember which mod that was?
    1 point
  3. I had the same problem today i just kept trying for like an hour and than it finally worked (like after an hour of retrying every time)
    1 point
  4. I think it worked! Thank you very much!
    1 point
  5. Your directory that you're calling doesn't contain a prepared gradle, or no build.gradle at all Try reloading your gradle project, on that image @Kosh sent, it's that little flowing circle button on the left side, if that fails, close intelliJ and reopen it, and open it in the folder which contains your build.gradle file and it should jump to life It will take a moment, so keep an eye on the bottom right progress bar Well done for choosing IntelliJ, kings use it only
    1 point
  6. Yeah, I'd check to see what tick that you're referencing during this block: else if (FoodUtils.isBone(stack)) { Minecraft.getInstance().setScreen(new WolfFoodConfigScreen(this)); stack.shrink(1); return InteractionResult.SUCCESS; } add a level.IsClientSide() check before setting that screen so that when the server side tick passes through that function, it is ignored
    1 point
  7. So Minecraft.getInstance().setScreen(....); opens screen for both client and server side? It looks like it solve my problem. Thank you!
    1 point
  8. Line 522: java.lang.IllegalStateException: Rendersystem called from wrong thread Screens are client side only, so make sure you're opening the screen from the client
    1 point
  9. Follow the code through from Mob.interact() for a cat. It will pretty much ignore you unless your item is food. Unfortunately, there is no item tag for name tags. Mob.checkAndHandleImportantInteractions() hardwires the vanilla name tag item instance for special handling instead of usiing an item tag.
    1 point
  10. That's because the interaction that happens on right click for tamed animals (like the wolf and cat) forces them to sit, which is a consumable action, preventing the stack logic from executing. Since the only hook to get around this is an event, you would need to subscribe to `PlayerInteractEvent$EntityInteract` and call the `#interactLivingEntity` method on your item stack there.
    1 point
  11. You can do it in a few ways: 1) open Gradle panel on the right side of your IDE and click on what you need to run 2) Open "terminal" tab at the bottom of your IDE and type command you d'like to run
    1 point
  12. Minecraft does not have generic support for scheduling things. There is special support for things like playing sounds, mob effects (e.g. potions wearing off) and scheduling block/fluid ticks (e.g. delayed spread of liquids). For other things you need to code it yourself. You definitely don't want to do things with threads, including sleeping. You will just break things. First you need to remember your data somewhere that is relevant to what you are doing, e.g. setting the countdown to the event in a Player capability. https://forge.gemwire.uk/wiki/Capabilities Then you subscribe to the relevant tick event, e.g. PlayerTickEvent which will decrement the countdown and does the processing when it reaches zero You can see this kind of processing in many places in vanilla, e.g. Entity.remainingFireTicks, Entity.portalTime, LivingEntity.removeArrowTime, etc. Pay attention to the side (client or server) and phase (start or end of tick) of the tick event, so you are processing things in the correct place.
    1 point
×
×
  • Create New...

Important Information

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