Jump to content

DavidM

Members
  • Posts

    1830
  • Joined

  • Last visited

  • Days Won

    12

Posts posted by DavidM

  1. 10 minutes ago, red_ said:

    I think you'd be better off starting an issue on github than posting here. That way it's easier to keep track of.

    People should post issues on the forum first, and open them on GitHub if the issue is approved on the forums.

    By doing so, the GitHub issues wouldn't be flooded with repeated reports/bugs that are not actually bugs/problems caused by user error.

  2. I don’t see why a block of metal should be melted down into exactly one bucket of liquid.

    There is no reason why the two should be equal (besides perhaps a slight convenience in calculating resources, but will likely cause more troubles than benefits).

  3. 9 hours ago, ninjawizard said:

    my friend dont be rude with me, this is a forum to help others learn how to code java for minecraft isnt it?

    Telling you to learn Java before modding is not rude; it is a prerequisite for modding, and you cannot mod Minecraft without knowing Java.

    This is not a Java forum; if you need help learning Java, try some of the other programming-specific forums out there (i.e. StackOverflow).

     

  4. 29 minutes ago, Kriptarus said:

    - Is each block posted in the world a completely new instance of it's class?

    No.

     

    29 minutes ago, Kriptarus said:

    - Is it possible for the same block already posted to keep being updated constantly?

    - I don't want to make the block keep values after it being broke, but in i'll need to manipulate variables while it exists in the world.

    Yes and yes.

     

    Check out TileEntity and ITickableTileEntity.

    • Thanks 1
  5. 58 minutes ago, MickeyD3557 said:

    With all that in mind, can that be done only by hooking onto events?

    Yes.

     

    58 minutes ago, MickeyD3557 said:

    Would I need to change the entity coming in in order to add new features for animation?

    No.

     

    58 minutes ago, MickeyD3557 said:

    If I wanted to do a vertical slash, and there were 2 enemies in front of me, stacked on top of each other, like a spider jockey, they should both be hit. If the hit boxes are in the entity, then I would need to change the hit boxes in the entity based on the action.

    You don't need to change the hitbox. Just subscribe to an attack event and change the way hitbox are calculated in an attack.

    • Like 1
  6. 47 minutes ago, xanela said:

    So I need to ask for hypixel to install it if i had that mod installed on me or uninstall it?

    If the server does not have common mods installed, then you cannot have them when connecting to the server.

     

    Hypixel is a vanilla server, and they will likely never change that, so you will have to remove the aforementioned mods if you want to play on Hypixel.

  7. 6 hours ago, Novârch said:

    It seems that was the issue, setting the arrows velocity to 0 instead of setting it's position every tick fixed the issue, but now I have a new issue, all arrows face south during timestop.

    In my previous mod where I attempted the time stop, I didn't cancel the velocity completely. I set them to 0.05 of the original value. This allows projectiles like arrows to maintain its direction, but might not be suitable in your case. I'm not aware of any better ways, but if you would like to sacrifice the "total time stop" in favor of having correct rendering of arrows then it may be worth a try.

     

    6 hours ago, Novârch said:

    I've been trying to do that, but to no avail, how am I supposed to send ALL the velocities in one packet and map them to the correct entity?

    Make an array (length N) of UUIDs containing all the N entities in the world.

    Make another array (length 3 * N) containing the velocity of entities in the same order as the entity array.

  8. 25 minutes ago, henne90gen said:

    I tried all the GuiScreenEvent.Keyboard* classes.

    Nothing makes the keybinding.isPressed method return true.

    They are definitely being called, but the keybinding is not being triggered.

    The inventory screen for example worked right away, but as I said, the ChestScreen is giving me some trouble.

    That is expected, as key binds are not triggered inside screens.

    4 hours ago, DavidM said:

    IIRC key bindings are not fired when inside a Screen.

     

    You will need to check KeyboardKeyEvent#getKeyCode manually in the event.

  9. 3 minutes ago, daveash said:

    Is is possible to get an example on how to use the new method?  I've tried to find one and all I get are examples of the old way.

    You can pass in a lambda that takes no parameter and returns an instance of EffectInstance.

    Something like:

    .effect(() -> new EffectInstance(yourDesiredEffect, yourDesiredDuration, effectLevelOrSomething), yourProbability);

     

  10. 16 minutes ago, byalexeykh said:

    EntityTrace.getEntity().attackEntityFrom(DamageSource.causePlayerDamage(mc.player), 3)

    You cannot do that on the client side. That method should be called on the server side.

    You should do the ray tracing on the server side (there might be a slight difference in player's facing with the client though).

  11. 36 minutes ago, MickeyD3557 said:

    If I wanted to create a custom player entity, to overwrite the functionality of the player, how could I do that? I have noticed that the player is initialized in net.minecraft.client . If Overwriting this variable is what I would need to do, how would I go about doing that? If I need to, can I/ how do I change some of the code in this main Minecraft.java file?

    You can't.

     

    What are you trying to achieve? What is your mod going to do? It is likely that what you are trying to achieve does not require modifications to the vanilla files.

  12. 3 minutes ago, jakethesnake123 said:

    so where would you actually make it open the gui?

     

    Override Block#onBlockActivated and open the GUI there.

    If your GUI has a server-side container counter-part, use NetworkHooks::openGui on the server side (by checking if World#isRemote is false).

  13. 33 minutes ago, Nicholas Hammond said:

    I will not be rewriting code as it is very helpful when using templates from MCreator.

    Don't use MCreator. It produces broken code as well as clogs up the mod jar with unnecessary fuss. More reasons can be found here.

    If you want to mod please learn Java and do it properly.

  14. 12 hours ago, Axspeo said:

    I actually found out what the problem was, the method has to be static... ?

    Note that the method only has to be static if you are registering the event subscriber class with @EventBusSubscriber.

    It should be non-static if an instance of the event subscriber class is constructed and registered via the event bus' register method.

    • Thanks 1
  15. 29 minutes ago, [NoOneButNo] said:

    return; //Just in case someone stupid enough to pass in a null player

    I'd say it is safe to not null check that, as firing a player tick event with a null player is definitely going to cause problems, and wouldn't be out of place to expect a NPE.

  16. 1 hour ago, sciwhiz12 said:

    It works! And such a simpler solution than modifying class bytecode. A problem that I see doing this though is the nameplate is delayed in rendering, so it doesn't exactly follow the player model. (like when using command blocks to teleport armor stand to the player, there's a small gap when the player moves until the armor stand gets back in position to the player)

    There won’t be any delay as you are rendering during the same frame.

    Rendering per frame is drastically different from executing a command in a command block.

  17. 51 minutes ago, Novârch said:

    I think I've made some progress on this, the packet should in theory set an entities velocity on the client to it's velocity on the server

    That would send a packet for every entity in the world, which is rather inefficient considering that when the time stops, all the values in the velocity would be 0. I would suggest making a separate packet for time stopping and time continuing.

    Moreover, I would suggest to send a list of all affect entities in one packet. However, if you really want to update the velocity individually, change the velocity of the entity directly and call Entity#markVelocityChanged. This will make the game sync the entity's velocity on the next tick (therefore custom packets are not necessary) (this would send a packet for each marked entity, which would be inefficient on a large scale).

     

    I'll check the arrow problem out, but I think it might be caused by the arrow's still picking up downward velocity from gravity every tick. In one of my mod I implemented a similar time stopping concept, and circumvented similar problems by keep setting the velocity of affected entities to 0. The client logic is similar to:

     

    listEntity <- a list of entities affected by the time stop;

    onStopPacketReceive: add specified entities to the list;

    onContinuePacketReceive: remove entities from the list;

    onTickEvent: set the velocity of all entities in the list to 0;

    • Thanks 1
×
×
  • Create New...

Important Information

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