anvil input - DevNatan/inventory-framework GitHub Wiki

Anvil Input allows the developer to process what the player wrote in an anvil's text field.

Anvil Input is experimental and is not subject to the general compatibility guarantees given for the standard library: the behavior of such API may be changed or the API may be removed completely in any further release.

Versions Compatibility

Server version Minimum IF version Status
1.8-1.19 ⚠️ Not tested
1.20 v3.0.0 ✅ Supported
1.20.2 v3.0.3 ✅ Supported
1.20.4 ❌ Not supported yet (see #620)
Anvil Input is a Protocol-Level Integration so its behavior is based on the current version and software of the server it is running on and may be inconsistent. See the Versions Compatibility table to know if it will work on your server.

Installation

Anvil Input is a external feature so you need to include it on your project build file

implementation 'me.devnatan:inventory-framework-anvil-input:<version>'

And install it in your ViewFrame in order to be able to use it

viewFrame.install(AnvilInputFeature.AnvilInput);

Introduction

Anvil Input feature is often used for "searching something"-like views, it integrates very well with other features like Context Flows without having to write extra code for it.

Now you know everything!! Lets get started 🚀

Getting Started

In your view, create a new AnvilInput instance to get started.

final AnvilInput anvilInput = AnvilInput.createAnvilInput();

Then, apply it into your view configuration.
Use use(Modifier) to apply Anvil Input as a configuration modifier.

Preview
@Override
public void onInit(ViewConfigBuilder config) {
    config.title("Hello world")
          .use(anvilInput); // <-- Look here
}

...This document is still being written...

Technical Details

Here's some details that you may want to know about Anvil Input feature.

⚠️ **GitHub.com Fallback** ⚠️