-
Posts
167 -
Joined
-
Last visited
Everything posted by Turtledove
-
[unsolved] Can't hit player from entity AI w/ attackEntityFrom
Turtledove replied to Turtledove's topic in Modder Support
Haha nah I was in survival. Just one of those times where you can't figure out why something finally works, so you just accept it and move on lol. -
[unsolved] Can't hit player from entity AI w/ attackEntityFrom
Turtledove replied to Turtledove's topic in Modder Support
...huh, rebuilding the project got it to work. The heck? -
I have a very basic AI class where if the player gets within a certain area of the entity, then the player takes damage. So I did the usual; get the bounding box, scale it, offset it, and iterate the list for valid entities. The thing is, it works, other mobs take damage without any issue. However, I can't seem to get hit. It's in the AI class so it's not a server-client issue, plus when I print the list of entities in the AABB it does detect the server's player class. What am I missing here? This is all there is in my update method: List<LivingEntity> swipeEnemies = this.entity.world.getEntitiesWithinAABBExcludingEntity(entity, entity.getEntityBoundingBox().expand(5.0,1.0,5.0).offset(-2.5D,0D,-2.5D)); if (!swipeEnemies.isEmpty()) { for (LivingEntity targ : swipeEnemies) { targ.attackEntityFrom(DamageSource.causeMobDamage(entity),12.0F); }
-
Biomes o plenty failure at registries event phase
Turtledove replied to Sincalloway's topic in Support & Bug Reports
-
It looks like the attribute speed is set to 1 but you pass 0.5 to your wandering AI, for reference the vanilla skeleton has a default speed attribute of 0.25 and passes in 1.0 to its wandering AI
-
Biomes o plenty failure at registries event phase
Turtledove replied to Sincalloway's topic in Support & Bug Reports
Just google it dude -
updating 1.10.2 to 1.12.2 textures and other stuff not working
Turtledove replied to MagicQuest's topic in Modder Support
and 1.12 isn't supported on this forum anymore, use 1.15 -
Getting entity currently being looked at, server-side [SOLVED]
Turtledove replied to Turtledove's topic in Modder Support
Thanks all, got it resolved. I used both AABB and basic linear algebra to check for intersections. -
Getting entity currently being looked at, server-side [SOLVED]
Turtledove replied to Turtledove's topic in Modder Support
I already have a function that does line segment-plane intersections for an entity's location and height, but it's moreso for my AOE attacks, not for precise single-entity-hits. -
I'm overhauling combat, and part of that, I've cancelled all the vanilla events related to that (left click, left click on block, left click on entity, etc) and am now sending packets back and forth from server/client to determine when and how a player should attack. However, an element I'm missing server-side is the ability to get the entity currently being looked at. So when an entity is struck, the event is canceled and a packet is sent to server, to my capability class where the rest of the logic is done. I've sent over that entity's position but I've two questions: 1) Is raycasting based on the player's look vector unreliable server-side? 2) If I just do a basic AABB bound check, do you think it's too imprecise? For both cases, I'm thinking of situations where an entity is flailing about, or shares similar coordinates with another mob (say, a Villager and a jumping chicken) that shares the same coordinates, but not necessarily the same boundary spaces. Should I be doing something else?
-
I already have the cooldown set up as a capability serverside with IPlayerData, which is also where it's incremented every tick. In my server to client message handler, do I just set that variable in the same class (but on the client) and access it as normal in the event handling method? So I guess in that case there'd be a server and client version of my IPlayerData running at the same time, correct?
-
I'm overriding vanilla sword behavior, such that the player cannot swing their sword unless a certain amount of ticks have passed, which is determined by logic done on the server. I've got everything already setup, and the packets are successfully sent to client. However, I'm not sure how to retrieve this information within my input handler class's static mouse event, from my message handler. Is there a better way of doing this than creating a static member variable inside the event handler class?
-
You know, you could just look at his github yourself, just googled it for you: https://github.com/Ckathode/archimedes-ships it's very outdated but the idea wouldn't have changed much.
-
Apologies, I was out and about when I posted that Anyhow, the more i think about it I think it's best if I do more of the logic server-side instead, with what I'm trying to do. I need to prevent the player from swinging the sword until a certain number of ticks pass, so I'll probably just attach a value to the player whether they can swing by incrementing a tick counter on the server. Then send a packet to the client when they can swing again, and either let it happen or cancel swinghand like you said.
-
I don't cancel anything related to attack logic clientside, I only cancel the render event there. I cancel the event that attackentity calls, on the server. So the results should be something like: Player left clicks -> Cancel render event, render my own weapon animation -> send packet to server -> Cancel the attack event if the source is from a player holding a sword, otherwise leave it alone -> call attackentity manually, but change damage source to custom, that way it can pass through the previous step when it's called a second time. And I'm not sure if there's a better way to do this
-
Based on the default player inputs (left click with WASD), I'm trying to change the behavior of sword attacks, however I've run into a problem. 1. Server-side, I've gone and cancelled the event whenever the player is attacking an entity with a sword, this is the event thats called whenever attackEntityFrom is called. 2. Client-side, when the player presses the left key and strike, I cancel the vanilla sword animations + rendering, and do my own. Then I send a packet to server to let it know to do my logic there. 3.???? Step 3 is the problem, I then need to be able to call attackEntityFrom, but it would get cancelled because of #1, correct? What do I need to do to circumvent this?
-
I want to detect whether an entity is in a NON-axis aligned plane boundary in front of the player, that rotates with the player's pitch and yaw. I've done the linear algebra and it works. The plane is directly in front of the player, with width 0.6, length 2, and it is 1.6 units above the player's world coordinates and this is my implementation of that. Graphed, this is when I'm directly facing a testificate, in the plane's coordinates. A,B,C are the 3 corners of the plane, and E and D is the coordinates of the bottom and top of the villager, respectively. Another view, from the XY plane: As you can see, it clearly intersects, and graphing where t=1.3 corresponds to in the parametric equation results in the correct intersection (it's F): That said, when I then cancel the vanilla event, and cause damage to the entity in code, nothing happens. Is it possible that when I make that damage call, it calls the same attack event method again, which is then canceled? Disregard, I figured it out the second after I posted it. There was a typecast to int that shouldn't have been there that was setting the flag to false. Also the event is only called for the client.
-
Have you tried reading the docs or googling? Extend an existing item class of whatever category your custom item pertains to.
-
[solved] Detecting key inputs from render event? - 1.15
Turtledove replied to Turtledove's topic in Modder Support
Ah that's just what I was looking for, thanks. -
[solved] Detecting key inputs from render event? - 1.15
Turtledove replied to Turtledove's topic in Modder Support
How do I get keybinds from an event that doesn't use them for its event?