Jump to content

Iron1601

Members
  • Posts

    30
  • Joined

  • Last visited

Posts posted by Iron1601

  1. Thanks.

    I do wonder though, why are they called Capabilities? What does that mean in this context? I would imagine it's the ability for an object to do something, which then I'm not sure how that translates to checking if it is doing it, but then there are types and also "facing" which I don't think is like in world directions. 

  2. I want to have a field or some attribute to PlayerEntity that indicates whether the player is pressing a key.

    I've tried DataManagers but the id value overlap makes me think that is the wrong way to do it on top of causing exceptions.

    I've also tried Lists and such to store players that did but sidedness and thread safety make me think thats also the wrong way.

    My question is how do I add this boolean attribute in such a way that avoids sidedness and is the proper way?

     

    Thanks.

  3. I'm trying to add an attachment to a PlayerEntity without adding an entity that follows the player. I've narrowed it down to extending PlayerRenderer but the problem is that it uses AbstractClientPlayerEntity which I couldn't find the EntityType for it (if it even exists), which I think I need to register the Renderer (RenderingRegistry.registerEntityRenderingHandler).

    Is there a different way to register the Renderer or some other way to extend PlayerRenderer?

     

    Thanks.

  4. I've been working on a projectile type entity but I cant get it to move smoothly without extending some other class that adds logic that interferes with what I'm trying to do or straight up breaks everything.

     

    I'm trying to simply get it to stop when hitting a wall and to stick to an entity when hitting it and moving with it.

    Extending ThrowableEntity makes it break on impact. Extending ArrowEntity forces some methods that are unrelated and causes nullPointerExceptions referring to some data managers. Extending ItemEntity is the closet I've gotten to what I'm trying to do, however continues to slide on the floor.

     

    Working around any of these cause it to either stop before hitting the ground, go into blocks, move erratically or rubber-band.

    I would imagine some sort of ArrowEntity type thing will work best since it has pretty much all of what I need but extending it causes problems and extending AbstractArrowEntity adds methods and sometimes crashes.

     

    Seeing this I tried controlling either the motion or position directly but setPosition every tick makes it jitter and rubberband, setMotion doesn't affect anything directly, from what I've seen, and instead has to go through super.tick() (for ProjectileEntity) or move() (which forces it into the ground sometimes).

     

    I would appreciate any help especially regarding the correct way to do this, since seemingly every Entity class has a different way of doing it, sometimes using privated fields or methods which are no fun.

  5. I'm looking to make the constructor of ProjectileEntity public or at least protected and im getting

    Quote

    line 1:30 no viable alternative at input 'public net.minecraft.entity.projectile.ProjectileEntity <init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)'
    Exception in thread "main" java.lang.RuntimeException: 
        at net.minecraftforge.accesstransformer.parser.AtParserErrorListener.syntaxError(AtParserErrorListener.java:8)

    which to me means that there is a syntax error.  I haven't managed to locate the problem.

    Any help would be appreciated.

  6. I think it goes only up to 3 blocks because thats the reach of a regular PlayerEntity, might be wrong though/

     

    I think your question is how to find entities on a line from one Vector3d to another. Now I know this isnt really your question but there is another way to trace entities. 

    You create an AABB (AxisAlignedBoundingBox) starting at your start vector and ending at the end vector and using the world object you are raytracing in you use getEntitiesWithinAABB to get the entities that are in the cube with a vertex at the start vector and the opposite vertex at the end vector. You then iterate over the entities and use Entity#getBoundingBox#rayTrace to check if the entity is on the line.

    The parameters of AABB are the top corner and the opposite corner.

    The parameters of getEntitiesWithinAABB are a class object which determines which entities the function is checking for in the bounding box, i.e if you give it ProjectileEntity.class it will only return a list of entities that extend ProjectileEntity, and the bounding box AABB.

    The parameters of rayTrace are the start and end vector that define the line you are checking for.

     

    If you just want to know if a line goes through the boundingBox of an entity entity.getBoundingBox.rayTrace(start, end) should do it.

     

    You can also use  something like World#getEntitiesWithinAABBExcluding to exclude the shooter.

     

    I must say aswell, looking at it now ProjectileHelper#rayTraceEntities seems to do that ^ ish and take  the same parameters needed there so hope it explained that too.

     

    Hope this was helpful and answered your question 

  7. What's the return type of a constructor? stack overflow says void which by the forge docs means that no return type is needed?

     

    And yes I agree there is no reason to AT your code but this was just a temporary measure just to not cause any other errors.

     

    This is the :comileJava error message I'm assuming that's what you mean. I cant really find any log file in the run/logs or logs  folders that seems relevant.

    log,txt

  8. I would imagine this means there is something wrong with the line since puttin a space between the "private com.example.examplemod" and the "<init>" fixes it.

    I guess this means there is some syntax problem with 

    Quote

    public net.minecraft.entity.projectile.ProjectileEntity <init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)

    Same error on both to be clear

     

    I see now it says "Syntax error" so I guess there's that but what error?

  9. Quote

    Could not resolve all files for configuration ':compileClasspath'.
    > Could not find net.minecraftforge:forge:1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.
      Searched in the following locations:
        - https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.pom
        - https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.jar
        - file:/C:/Users/Iftach/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.pom
        - file:/C:/Users/Iftach/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.jar
        - https://libraries.minecraft.net/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.jar
        - https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.pom
        - https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.jar
      Required by:
          project :

    Possible solution:
     - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

     

×
×
  • Create New...

Important Information

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