Problem with tridents and area effect clouds

Started by Amonster on

Topic category: Help with modding (Java Edition)

Last seen on 19:29, 2. Oct 2023
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Problem with tridents and area effect clouds

Hello, I've been pulling my hair out trying to find a way to detect when a trident is thrown (not used/right-clicked) and where it lands. When a global variable is set to true for player lifetime, if a trident, or spear, is thrown, I want it to strike lightning where the thrown trident entity is. Also, for a custom item, I want this dropped item entity to be converted into a different custom item when it is in one of the slowness area effect clouds for a set amount of ticks. This is not necessary, but I would prefer it if when the item is dropped in the cloud, it is turned into an unpickable item and rises about a block until it is turned into the new item. In short I need a way:

  • To detect when and where a trident is thrown
  • To convert one item into another when it is colliding with a slowness effect area effect cloud (there are multiple variations)
  • To add an effect when the item is being converted (I don't care about this that much, right now I want to focus on the essential stuff and make things pretty later).
Last seen on 19:29, 2. Oct 2023
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
To determine when a trident…
Mon, 12/19/2022 - 05:50

To determine when a trident is shot, install this plugin: https://mcreator.net/plugin/90870/more-item-triggers 
To install plugins, go here: https://mcreator.net/wiki/understand-plugins (I used Method B for 2022.2 and 1.16.5)

Once it is installed, go to the advanced section and click and drag the 'is provided itemstack extra tooltype' block. Set it to trident. Make sure your global trigger up top is set to when the player stops using an item (NOT finishes).

No external api is necessary for this particular plugin (unlike plugins like Curios).

 

I'll keep updating this if I get the answers to my other questions.

Last seen on 19:29, 2. Oct 2023
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Unfortunately, the global…
Mon, 12/19/2022 - 08:21

Unfortunately, the global trigger I was using has a bug. Essentially, if you end your drawback of the trident before you throw it, it will still run the procedure since it counts as stopping.

Last seen on 19:29, 2. Oct 2023
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay, new approach. I'm…
Tue, 12/20/2022 - 03:34

Okay, new approach. I'm thinking of doing something similar to this post: https://mcreator.net/forum/62963/be-immune-lightning-player 

I'm going to change the damage source to a trident and detect if the source entity has a global variable set to true. So if an entity is attacked by a trident, detect if the variable is true, and strike lightning (instead of canceling the event) where the event/target entity is.