1.16.5 HoverEvent Content... Constructor

Discussion in 'Spigot Plugin Development' started by TaskID, Oct 31, 2020.

  1. Hello.

    I am currently working with HoverEvents, and it says that
    Code (Java):
    new HoverEvent(type.getHoverAction(), new ComponentBuilder(text).create());
    is deprecated.
    There is a constructor with
    Code (Java):
    new (HoverEvent.Action action, Content... contents);
    but I don't know how to use it, or how to create a "Content"
     
  2. You do know that Content... means it's optional?
    EDIT: If you still want to pass text you can do the following
    Code (Text):
    new Text(yourBaseComponentArray);
    or
    new Text("yourText");