Skip to content
Tennantite
中文
Documentation

CreateFilterScreen

Create filter screen (1.21.1 original atlas): 2×9 item grid, deny / allow and NBT two-state buttons, AND / OR toggle and player inventory.

Full-screen previewPreview pages are excluded from search indexes

Composition

These are the composable components; the Block only places them at vanilla coordinates.

Code

import { useState } from "react";

import { CREATE_DEMO_INGOT, CREATE_DEMO_PLAYER } from "../create-demo-data";
import { CreateFilterScreen } from "./index";

/**
 * CreateFilterScreen 预览用例:白名单 + AND + 不比对 NBT。
 */
export function CreateFilterScreenDemo() {
  const [mode, setMode] = useState<"and" | "or">("and");
  const [match, setMatch] = useState<"allow" | "deny">("allow");
  const [respectData, setRespectData] = useState(false);
  return (
    <CreateFilterScreen
      items={[CREATE_DEMO_INGOT]}
      match={match}
      mode={mode}
      onMatchChange={setMatch}
      onModeChange={setMode}
      onRespectDataChange={setRespectData}
      player={CREATE_DEMO_PLAYER}
      respectData={respectData}
    />
  );
}