Jump to content

Novârch

Members
  • Posts

    422
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Novârch

  1. 28 minutes ago, diesieben07 said:

    Effect#isReady is called every tick. If that returns true (it does not by default, so you need to override it!), Effect#performEffect will be called that tick as well.

    This happens for all entities your effect is currently active on.

    This helped, thanks you!

     

    16 minutes ago, Draco18s said:

    Also, what happens if there are two players, both set their effect active, and then one sets it inactive?

    Just tested that, works fine without any modification of the code.

  2. I'm trying to remove a potion effect from all entities in a world using ClientWorld#getAllEntities, since this method is in ClientWorld I do it from ClienTickEvent with this code:

    Spoiler
    
    Minecraft.getInstance().world.getAllEntities().forEach(entity -> {
                            if(entity instanceof MobEntity)
                                if(((MobEntity) entity).isPotionActive(EffectInit.CRIMSON.get()))
                                    ((MobEntity) entity).removePotionEffect(EffectInit.CRIMSON.get());
                        });

     

    But it doesn't take the effect away, I suspect potion effects aren't synced to the client and that the second if statement is always false because of it. For more context the class in which this code is being run can be found here as a git repo.

    Are there better ways to get all entities in a world, or am I doomed to use 8 for Entity entity : World#getEntitiesInAABBexcluding? (1 for every direction)

  3. 3 minutes ago, Cyphon said:

    I'll be starting fresh with this mod, not like I had much.

     

    Learning how Minecraft is coded directly from it's code sounds like exactly what I want.

     

    How would I go about looking through vanilla code in Eclipse?

    Or is there another program you would reccomend?

    Referenced libraries

  4. 1 hour ago, Cyphon said:

    I'm following TechnoVision's 1.15.2 modding tutorials, for reference.

    Please, don't, they're pretty bad. It's better for you to look at vanilla examples and other people's mods like Botania.

     

    1 hour ago, Cyphon said:

    ItemBase.java, which is in src/main/java/items:

    Don't make base item classes, it'll just be a nuisance when you want to extend something else.

    Besides that looking at your problem I don't see anything wrong, post more code, preferably as a git repo.

  5. 1 minute ago, BigWordsScareMe said:

    My intention was to randomly generate a number for each player to join that game

    Capability, PlayerLoggedInEvent and World#rand.

     

    3 minutes ago, BigWordsScareMe said:

    then if this mob sees you it attacks you

    Check the double you'll put in the capability in an event, maybe EntityEvent?

  6. 9 hours ago, imacatlolol said:

    There's your problem.

    The event is normally intended to be used by simply setting the fog density via the event's setDensity method. The same goes for the fog color.

    A density of 0.3 will produce a very similar effect as the vanilla method, but it's not perfectly identical since vanilla uses more complex methods. However, the difference is very subtle and none of your users will likely even notice.

    If you really want an identical effect, you should set the density to 0 and then use those four RenderSystem method calls towards the end.

    Thanks for the help, gotten the exact effect I was looking for!

  7. 1 hour ago, imacatlolol said:

    The effect is controlled by FogRenderer#updateFogColor, and FogRenderer#setupFog. Look for the usages of Effects.BLINDNESS to see the exact math it performs.

    Hook on to the EntityViewRenderEvent$FogDensity and EntityViewRenderEvent$FogColors events to override the vanilla behavior and do your own logic (the former event will need to be canceled for your stuff to work).

    I recommend using a lower event priority and then checking the state of the events so that other mods can override your system if desired.

    Thanks for the help! Everything works fine except this line, and it seems that it's pretty important because nothing renders when I remove it.

  8. I'm trying to make a potion effect that combines a few vanilla potion effects, the purpose being being able to easily remove it without removing effects the player might have had prior to getting it, one of these effects is blindness. How does the blindness effect work? Does the game check whether you have it while rendering, can I replicate it's functionality with an event?

  9. 4 minutes ago, martiblq said:
      Reveal hidden contents

    if(event.getPlayer().getHeldItem(Hand.MAIN_HAND).getItem() == Items.NETHER_STAR)
            {
                
            }

    this is the code for the held item. i can't just paste it in the block

    Of course you can't, 

     

    39 minutes ago, imacatlolol said:

    use the PlayerInteractEvent$RightClickBlock event.

     

  10. 6 minutes ago, Crispy said:

    Cant seem to find the reason why ice and fire, i have tried updating the mod, i have all the support mods for it, and i have updated those, and removed them. crash log is attatched. Any help would be greatly appreciated. Thanks

    crash-2020-05-14_18.26.50-client.txt 30.46 kB · 1 download

    1. A class is missing from the mod, either you installed it wrong or it's on dev.

    2. Versions 1.12 and below are no longer supported on this forum. Please update to a modern version of Minecraft to receive support.

  11. 2 hours ago, Satsue said:

    I'm trying to create my own client and it started off working fine but after coding things in it I couldn't run Minecraft anymore. It opens fine but I can't join my survival world to test it on. I am not getting any errors in Eclipse either, I don't know what I'm doing wrong.

    Console + Crash report - https://pastebin.com/AVtzfLTv

    1. Remove Optifine and try again.

    2. Don't make your own client's.

    3. Version 1.12 and lower ARE NO LONGER SUPPORTED ON THIS FORUM. Please update to a modern version of Minecraft to receive support.

  12. 25 minutes ago, TheElvenArrow14 said:

    So I just got my first linux computer and I was wanting to try modded minecraft. However, I'm pretty confused as to how to install forge. For reference I'm running Ubuntu 20.04. HELP PLEASE!

    Context is required, just saying "HELP PLEASE!" will get you nowhere.

  13. 8 minutes ago, TheKFL said:

    Hey, I am having trouble with people trying to join my server. When I join my server it operates just fine but when my friend joins it kicks both me and my friend off. I am wondering what the issue is and if it is a server issue or client issue. I will post where my friend joins and then the server closes.

    ServerCrash.txt 12.73 kB · 1 download

    1.7.10 is no longer supported on this forum. Please update to a modern version of Minecarft to receive support.

×
×
  • Create New...

Important Information

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