Jump to content

Harvesting blocks and TakeDelay


ErrorNull

Recommended Posts

  

hello everyone. i'm attempting my first xpath mod and below is my goal:

 

- when using salvaging tools like a wrench on a shower head, after 'destroy/removing' that block the player will obtain the shower head in their inventory.

- however, when using non-salvaging tools like an axe or pick, the player only receives scrap iron and maybe an iron pipe while harvesting.

 

Is there a way to define two 'Destroy' events for the same block to accomplish this? so far i've reached limited success within my blocks.xml. code snippet below:

 

<append xpath="/blocks/block[@name='showerHead']">
  
  <!-- shows salvaging animation with the tool -->
  <drop event="Harvest" tool_category="Disassemble"/>   
  
  <!-- allows all tools to receive these item drops while harvesting this block -->
  <drop event="Harvest" name="resourceScrapIron" count="4" tag="allHarvest"/>
  <drop event="Harvest" name="resourceMetalPipe" prob="0.5" count="1" tag="allHarvest"/>

  <!-- when destroyed, shower head is only received if salvage tool was used -->
  <drop event="Destroy" name="showerHead" count="1" tool_category="Disassemble"/>
  
</append>

 

as you see, the scrap iron and metal pipe drops are obtained by the player during usage of both salvage and non-salvage tools. however, i want these 'harvest' events only to execute during use of non-salvage tools. is there a tag other than "allHarvest" and "salvageHarvest" that can accomplish this?

 

alternatively, i noticed that the 'destroy' event, there is a value of 'disassemble' for tool_category, which forces its item drop only to execute for salvage tools only. is there another 'tool_category' value i can use that corresponds only to non-salvage tools?

 

also another question: i've been experimenting with the TakeDelay property, and it seems it is only relevant to blocks of class 'workstation'. is that correct? I am hoping to simply in introduce a takeDelay when picking up other normal blocks like tables, plants, etc.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...