Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DefaultDispenseItemBehavior dispenserBehavior = new DefaultDispenseItemBehavior() {
- @Override
- protected @NotNull ItemStack dispenseStack(@NotNull IBlockSource source, @NotNull ItemStack stack) {
- Direction direction = source.getBlockState().get(DispenserBlock.FACING);
- EntityType<?> type = ((SpawnEggItem) stack.getItem()).getType(stack.getTag());
- type.spawn(source.getWorld(), stack, null, source.getBlockPos(), SpawnReason.DISPENSER, direction != Direction.UP, false);
- stack.shrink(1);
- return stack;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement