User Tools

Site Tools


Sidebar

← Go back to the homepage

Fabric Tutorials

Setup

These pages will help you setup a productive development environment and semi-automated releases.

Basics

These pages are essential must-reads when modding with Fabric, and modding Minecraft in general, if you are new to modding, it is recommended you read the following.

Items

Blocks and Block Entities

Data Generation

World Generation

Commands

These pages will guide you through Mojang's Brigadier library which allows you to create commands with complex arguments and actions.

Events

These pages will guide you through using the many events included in Fabric API, and how to create your own events for you or other mods to use.

Entities

Fluids

Mixins & ASM

These pages will guide you through the usage of SpongePowered's Mixin library, which is a highly complex topic. We recommend you read these pages thoroughly.

Miscellaneous

Yarn

Contribute to Fabric

tutorial:ext_gh_commit

DELETEME This page does not make sense, errors can be found in the IDE on build, and usually are warned about before commits.

Using GitHub Actions to find errors in your mod.

GitHub actions is a very useful service that is provided free to public and private repositories. It allows you to automatically run commands or *actions* when an event happens.

To find errors, we'll be using the push and pull_request events.

Getting Started

First of all, create a file called error_action.yml in .github/workflows/ where your git repository is.

Put the following inside:

error_action.yml
name: Gradle Error Checker

on: [ push, pull_request ]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

This will run the Checkout step when a pull request is made or a commit is push. However, we want it to lint our code and find those darn errors.

Luckily for us, GitHub has a built in tool that can help us with that called SuperLinter.

To add super linter, add the following underneath the Checkout step.

- name: Check for errors.
        uses: github/super-linter@v3
        env:
          VALIDATE_ALL_CODEBASE: false

The VALIDATE_ALL_CODEBASE: false option makes sure we dont waste our time linting stuff that has already been checked. Superlinter will only check the files that have been changed in the commit or pull request. You can set this to true if you want to check the entire code.

Now, if an error is found. Github reports it to us!

Aha! GitHub has found an error for us!

/home/runner/work/MyRepo/MyMod/src/main/java/com/mymod/blocks/MyModBlocks.java:65: error: variable RAINBOW_GRASS not initialized in the default constructor
    public static final Block RAINBOW_GRASS;
tutorial/ext_gh_commit.txt · Last modified: 2022/08/16 20:38 by mineblock11