Jump to content

Recommended Posts

Posted

I havent been able to find a good resource for this and all the vanilla code here is obfuscated. I want to create a generic projectile entity i can use for my mod. most likely one that i will make sub classes of for more specific things. what I need to know about the entity is where its coming from (who or what shot it) and what direction its going, and when it hits something. Im not asking for someone to do the work for me, im just having trouble wrapping my mind around how it works and am looking for any good resources/tutorials/tips.

Posted

I would look at the vanilla SnowballEntity code.

If there are lots of srg names in there, update your mappings, and you should be able to get something halfway readable. I see this in the SnowballEntity in mine from 20200604:

Quote

   /**
    * Called when this EntityThrowable hits a block or entity.
    */
   protected void onImpact(RayTraceResult result) {

Which looks promising for what you're describing. Also of course look at the parent class.

Posted
1 hour ago, Mekelaina said:

what do you mean by update mappings?

in your build.gradle, find the mappings line like so:

Quote

mappings channel: 'snapshot', version: '20200604-1.15.1'

And change the date part to today. They don't often break, so using the current should be fine.

Then refresh your project in your IDE, and it should update the mappings used.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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