Skip to content

Anvil Input

Natan Vieira edited this page Nov 24, 2023 · 47 revisions

Anvil Input is a feature that allows you 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.

Installation

Anvil Input is a external feature so you need to include it on your project build file and install it in your ViewFrame in order to be able to use it.

// build.gradle
implementation 'me.devnatan:inventory-framework-anvil-input:3.0.0'
import me.devnatan.inventoryframework.AnvilInputFeature.AnvilInput;

viewFrame.install(AnvilInput);

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
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.

Introduction

Anvil Input feature is often used for "searching something", it integrates very well with other feature and having it implemented in the Inventory Framework ecosystem is incredible because you can integrate it with cool things 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
}

Note: Using type(ViewType.ANVIL) is not needed, view type is automatically set by Anvil Input feature.

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

Technical Details

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

Welcome to the Inventory Framework documentation.

▶️ Introduction

🧩 Core Topics

💡 Built-In Features

🧰 Extra Features

🤓 Advanced Usage

⚙️ Internal Mechanisms

🛠️ Tooling

You can find practical examples in the examples directory.

Clone this wiki locally