Projectile that breaks a block and gives it to the player

Started by Purple19842 on Thu, 07/28/2022 - 22:11

Topic category: Advanced modding

Last seen on 01:38, 3. Oct 2022
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Projectile that breaks a block and gives it to the player
Thu, 07/28/2022 - 22:11

i need some way to get the block that a projectile hits, break it and give it to the player

i tried putting the get block at x/y/z in the add to inventory block, but that wont work

 

Last seen on 20:58, 8. Sep 2022
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
isnt it possible to add a…
Tue, 08/02/2022 - 19:35

isnt it possible to add a procedure for when the projectile hits a block to save the block to a variable, break it and add it to the players inventory? (ignoring all the checks for hardness type etc.)

Last seen on 01:38, 3. Oct 2022
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I Thought so too, but the…
Thu, 08/11/2022 - 22:16

I Thought so too, but the variable blocks wont connect to the add item block

Last seen on 04:03, 30. Sep 2022
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You should be able to use…
Wed, 09/07/2022 - 17:46

You should be able to use the different entity types (source entity, and  immediate source entity) to determine the entitythat shot the arrow and give the item to them directly without saving it to a variable. If you can't, dont save the block to a variable, use the UUID plugin to save the UUID of the entity that shot the projectile to the projectile as a string nbt variable(entityUUID). Then for the procedure "when the projectile hits a block" do

for every player in the world OR for each entity in certain radius

if UUID of entity iterator == entityUUID

give player block