Creating achievement

Started by Taras Ogurtsov on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Creating achievement

Can anyone tell me how to make an achievement like "Sniper Duel", so that the player gets it when hitting a block from a certain distance?

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I understand that you use on…
Thu, 08/24/2023 - 16:12

I understand that you use on hit block trigger in ranged item. 

Can you go to folder entity and copy code from file @NAMEEntity.java and use pastebin to show what's in there? I want to check how mcreator generated it when your procedure is picked. @NAME is your ranged item name. 

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Maybe we're talking about…
Fri, 08/25/2023 - 16:09

Maybe we're talking about different things. I am using the procedure for on block hit by projectile, there is no new ranged item in my mod. Even if there is, could you explain in more detail where exactly this entity folder is? I'm sorry if I'm boring you already

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh, you have a block mod…
Fri, 08/25/2023 - 20:19

Oh, you have a block mod element. In that case, trigger you are using doesn't directly give a shooter, but you are able to get shooter with a code snippet, use this line and save shooter with a local variable with type entity:

((Projectile) entity).getOwner();

Code snippet should be in advanced section. 

Remember to check if it returned entity that is not null before doing anything, cause mcreator won't do this automatically, since its not in provided dependencies. 

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I did everything like you…
Fri, 08/25/2023 - 20:38

I did everything like you said except the last one. How exactly check if it returned?

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In one of sections (if i…
Fri, 08/25/2023 - 21:10

In one of sections (if i remember right its in advanced) there's block with "null". Check if your entity variable doesn't equal null. 

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm probably too dumb, but I…
Fri, 08/25/2023 - 22:06

I'm probably too dumb, but I can't figure out what I'm doing wrong. Could you take a look at the screenshot of that procedure and tell me what I did wrong?

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Here how it should look like…
Sat, 08/26/2023 - 18:21

Here how it should look like:

procedure

I was wrong aboul null, it turns out its no entity instead.

Also I made useless ent variable, we dont use it but we need mcreator to provide event/target entity from depencencies.

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah, it's working, just the…
Sat, 08/26/2023 - 21:09

Yeah, it's working, just the way it should. Thanks man, I really appreciate it! Thank you so much :)