Projectile that breaks a block and gives it to the player

Started by Purple19842 on

Topic category: Advanced modding

Last seen on 05:14, 7. Jul 2023
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Projectile that breaks a block and gives it to the player

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 02:44, 11. Mar 2024
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 05:14, 7. Jul 2023
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 06:22, 13. Mar 2023
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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