Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShulkerBullet not implemented in Projectile. #1901

Closed
SawFowl opened this issue Aug 29, 2018 · 8 comments
Closed

ShulkerBullet not implemented in Projectile. #1901

SawFowl opened this issue Aug 29, 2018 · 8 comments

Comments

@SawFowl
Copy link

SawFowl commented Aug 29, 2018

When writing a plugin, I ran into a problem. I need to get the entity that fired the shulker bullet.

@limbo-app limbo-app added the status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage label Aug 29, 2018
@RedNesto
Copy link
Contributor

Seems not hard to do.
We could even add the targeted entity and its direction.

@ryantheleach
Copy link
Contributor

I'm not 100% sure that a shulker bullet is a projectile in the classic sense.

But it should fit I think, and it should be doable. If it isn't it should at least be possible to expose some API for what you need.

@RedNesto
Copy link
Contributor

RedNesto commented Aug 29, 2018

It's not a projectile in the Minecraft source code, it's just an Entity with a Living owner and an Entity target (with a bonus direction).

Edit: Forgot to mention I am trying to implement it.

@SawFowl
Copy link
Author

SawFowl commented Aug 29, 2018

I was able to get the required entity via the IndirectEntityDamageSource. But this method is not very convenient, it would be better to get through Projectile.

@RedNesto
Copy link
Contributor

We could make it a Sponge DamagingProjectile, and the Shulker would be a ProjectileSource.

@RedNesto
Copy link
Contributor

I think this will require more thoughts.

The ShulkerBullet needs a target otherwise it would be useless (its vertical motion would just decrease), and with the actual Projectiles it is impossible to give a target, just a velocity.
Also EntityShulkerBullet does not use an AI task, but just onUpdate to track the target and decide where to go in order to reach it.
It could be a simple Projectile / DamagingProjectile or a whole new thing. Maybe a projectile variant like TargetingProjectile and a new ProjectileSource#launchProjectile overload to take a target.

@limbo-app limbo-app removed the status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage label Aug 31, 2018
@gabizou
Copy link
Member

gabizou commented Sep 11, 2018

I'm curious if we're allowed to modify the shulker bullet to simply tell it to move in a certain direction. I reviewed the onUpdate for it and it can be easily modified to use custom data fields that we set ourselves while avoiding vanilla's data, this way the shulker bullet will act with vanilla in mind, or if our data is not null, use our custom block position to point to a target.

This would be an added modification that we would have to maintain of course, something that I can see being done similarly to how mine carts are currently modified, or how the vanish api functions.

@RedNesto
Copy link
Contributor

I haven't seen that onUpdate recently but it is definitely possible to make the bullet target a Location or follow a specific Direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants