Quests icon indicating copy to clipboard operation
Quests copied to clipboard

API: New task type not working.

Open Jacobtims opened this issue 4 years ago • 4 comments

Description of Bug

When I use the API to create a new custom task type. The task will not executed.

Steps to Reproduce

TaskType Class:

package me.jacobtims.opkaddon2.tasks;

import com.leonardobishop.quests.bukkit.tasktype.BukkitTaskType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockBreakEvent;

public final class BlockBreakTaskType extends BukkitTaskType {
    public BlockBreakTaskType() {
        super("blockbreaktest");
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onBlockBreak(BlockBreakEvent event){
        event.getPlayer().sendMessage("Block broken!");
    }
}

Main Class:

@Override
    public void onEnable() {
        //Quests plugin tasks
        Quests questsPlugin = (Quests) Bukkit.getPluginManager().getPlugin("Quests");
        BukkitTaskTypeManager taskTypeManager = (BukkitTaskTypeManager) questsPlugin.getTaskTypeManager();

        taskTypeManager.registerTaskType(new BlockBreakTaskType());
    }`

Environment

  • Minecraft version: 1.16.5
  • Server software: Paper
  • Quests version: 3.9.1

Agreements

  • [X] I am running the latest version of Quests
  • [X] I am certain this issue is unique and a similar issue is not currently open
  • [X] I am using a version of Minecraft which is supported by Quests

Other

No response

Jacobtims avatar Sep 11 '21 11:09 Jacobtims

Make sure you task is actually accepted by the plugin, you should be able to see it in /q a types

LMBishop avatar Sep 11 '21 12:09 LMBishop

Yes, it's there.

Jacobtims avatar Sep 11 '21 13:09 Jacobtims

Make sure you task is actually accepted by the plugin, you should be able to see it in /q a types

Yes, it's there. What am I doing wrong?

Jacobtims avatar Sep 15 '21 15:09 Jacobtims

???

Jacobtims avatar Sep 17 '21 16:09 Jacobtims