Class EntitySelectorTest.ExampleCustomSelector

java.lang.Object
net.neoforged.neoforge.oldtest.chat.EntitySelectorTest.ExampleCustomSelector
All Implemented Interfaces:
IEntitySelectorType
Enclosing class:
EntitySelectorTest

private class EntitySelectorTest.ExampleCustomSelector extends Object implements IEntitySelectorType
Example for a custom selector type, works like @r but for entities. Basically does exactly what @e[sorter=random, limit=1, ...] does.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.commands.arguments.selector.EntitySelector
    build(net.minecraft.commands.arguments.selector.EntitySelectorParser parser)
    Returns an EntitySelector based on the given EntitySelectorParser.
    net.minecraft.network.chat.Component
    Returns an Component containing a short description for this selector type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExampleCustomSelector

      private ExampleCustomSelector()
  • Method Details

    • build

      public net.minecraft.commands.arguments.selector.EntitySelector build(net.minecraft.commands.arguments.selector.EntitySelectorParser parser) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Description copied from interface: IEntitySelectorType
      Returns an EntitySelector based on the given EntitySelectorParser.
      Use EntitySelectorParser.getReader() to read extra arguments and EntitySelectorParser.addPredicate(Predicate) to add the corresponding filters.
      If the token being parsed does not match the syntax of this selector, this method should throw an appropriate CommandSyntaxException.
      Specified by:
      build in interface IEntitySelectorType
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • getSuggestionTooltip

      public net.minecraft.network.chat.Component getSuggestionTooltip()
      Description copied from interface: IEntitySelectorType
      Returns an Component containing a short description for this selector type.
      Specified by:
      getSuggestionTooltip in interface IEntitySelectorType