CreativeMD / ItemPhysic

GNU Lesser General Public License v3.0
32 stars 17 forks source link

Dropping behavior with CraftTweaker player.give #125

Closed Oethever closed 4 years ago

Oethever commented 4 years ago

Minecraft: 1.12.2 Forge: 14.23.5.2854 Mods: ItemPhysic Full (1.4.34); CraftTweaker (4.1.20.574)

I found a very specific behaviour that is probably not intended, and is related to the CraftTweaker command player.give(IItemStack). Here are the steps to reproduce:

  1. Add a ZenScript file in scripts/ with the following content:
    recipes.addShapeless(
    "recipe1", <minecraft:stick>, [<minecraft:glass>], null,
    function(output, craftInfo, player) { player.give(<minecraft:dirt> * 2); }
    );
  2. Use the added recipe on a crafting table (1 Glass).

This results in the 2 blocks of Dirt being given in the player's inventory, and a new itemblock of dirt being spawn next to the player. This itemblock has a lifetime that seems to be proportional to ItemPhysic's general.despawnItem config entry, minus 6000 (e.g. if we set general.despawnItem to 6040, this itemblock will last 2 seconds).

I am unsure if the problem is on your end or CraftTweaker's end, so I am posting it here. I any case, I posted it there as well: https://github.com/CraftTweaker/CraftTweaker/issues/1002

Oethever commented 4 years ago

This issue has been resolved by CraftTweaker directly.