Issue with throwable item

Started by Alessandro15204 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Issue with throwable item
Thu, 01/06/2022 - 00:40 (edited)

G'day all
I made a throwable item that should explode when hit something(block,item and players).(basically a grenade)
The problem is that when I throw it explodes on me 

I have the same procedure on when hits player、 when hits block and when hits living entity.

So how can I avoid to explode when I throw it?

And which animation should I choose for it?

Edited by Alessandro15204 on Thu, 01/06/2022 - 00:40
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Solved by myself    Two…
Thu, 01/06/2022 - 00:40

Solved by myself 

 

Two procedures are needed 

first go in "when ranged item is used"

make this

[set event/target entity data logic NBT tag "tag name" to true]

[cooldown provided itemstack for (time in ticks) ticks for event/target entity]

[set event/target entity data logic NBT tag "tag name" to true]

2nd ones

in "when item hit living entity"

| if not get event/target entity  data logic NBT tag "tag name"
|
|do explode at x y z  with power "chose power(4 is tnt power)" type break]

 

I hope to been useful for anyone wants made explosive ranged items that can explode when touch entity or players but not you when you're throwing it 

For any other question on this feel free to reply