Skip to content
RustPluginGenerator

CanFastTrackCraftTask

CanFastTrackCraftTask is called when a player clicks the fast-track button on a crafting queue entry to move that job to the front and finish it immediately. Returning a bool overrides whether the fast-track is allowed.

Signature
object CanFastTrackCraftTask(ItemCrafter itemCrafter, ItemCraftTask itemCraftTask, int taskID)

Parameters

Hook parameters
ParameterTypeDescription
itemCrafterItemCrafterThe ItemCrafter component of the player who is trying to skip ahead in their crafting queue. Use it to read the owner with `itemCrafter.GetComponent<BasePlayer>()` or `itemCrafter.BaseEntity as BasePlayer`.
itemCraftTaskItemCraftTaskThe queued craft job the player wants to fast-track. Its `blueprint` holds the item being crafted and `remainingTime` shows how long is left.
taskIDintThe index of the task inside the crafter's queue. It matches the slot number shown in the crafting UI and identifies which task was clicked.

Return value

Return true to allow the fast-track and false to block it. Any non-bool return, including null, leaves the original game logic in charge so the task fast-tracks as usual.

How it works

This hook fires inside ItemCrafter.FastTrackTask, which the client calls when a player presses the fast-track control on a queued craft job. It runs after the game has already confirmed the clicked task is not the first one in the queue, so it only sees jobs that would actually be moved forward. The itemCrafter parameter identifies the crafter, itemCraftTask is the job being promoted (with blueprint, amount and remainingTime), and taskID is its position in the queue. Because itemCrafter is typed as ItemCrafter, you cannot narrow it to BasePlayer here; resolve the owner from the component when you need player data such as permissions or team. Returning a bool takes over the decision: true lets the fast-track proceed and false refuses it. Returning null (or a non-bool) leaves the vanilla behavior, which charges the resource cost of the remaining time and completes the task.

Example plugin: Restrict fast-track crafting to a permission

FastTrackPermission.cs
using System.Linq;
using Newtonsoft.Json;
using Oxide.Core;
using System;
using System.Collections.Generic;
using UnityEngine;

namespace Oxide.Plugins
{
    [Info("FastTrackPermission", "RustPluginGenerator", "1.0.0")]
    [Description("Restricts fast-track crafting in the queue to players with a permission")]
    public class FastTrackPermission : RustPlugin
    {
        private const string PermUse = "fasttrackpermission.use";

        private PluginConfig config;

        private class PluginConfig
        {
            [JsonProperty("Allow by default when no permission plugin is used")]
            public bool AllowByDefault { get; set; } = false;

            [JsonProperty("Blocked item shortnames")]
            public List<string> BlockedItems { get; set; } = new List<string> { "explosive.timed", "ammo.rocket.basic" };
        }

        protected override void LoadDefaultConfig() => config = new PluginConfig();

        protected override void LoadConfig()
        {
            base.LoadConfig();
            try
            {
                config = Config.ReadObject<PluginConfig>();
                if (config == null) throw new Exception();
            }
            catch
            {
                PrintWarning("Configuration file is invalid, using defaults");
                LoadDefaultConfig();
            }
            SaveConfig();
        }

        protected override void SaveConfig() => Config.WriteObject(config);

        protected override void LoadDefaultMessages()
        {
            lang.RegisterMessages(new Dictionary<string, string>
            {
                ["NoPermission"] = "You do not have permission to fast-track crafting.",
                ["ItemBlocked"] = "{0} cannot be fast-tracked on this server."
            }, this);
        }

        private string Msg(string key, string userId = null, params object[] args) => string.Format(lang.GetMessage(key, this, userId), args);

        private void Init()
        {
            permission.RegisterPermission(PermUse, this);
        }

        private object CanFastTrackCraftTask(ItemCrafter itemCrafter, ItemCraftTask itemCraftTask, int taskID)
        {
            if (itemCrafter == null || itemCraftTask == null || itemCraftTask.blueprint == null)
                return null;

            var player = itemCrafter.GetComponent<BasePlayer>();
            if (player == null || !player.IsConnected || player.IsNpc)
                return null;

            string shortname = itemCraftTask.blueprint.targetItem != null ? itemCraftTask.blueprint.targetItem.shortname : null;
            if (shortname != null && config.BlockedItems.Contains(shortname))
            {
                player.ChatMessage(Msg("ItemBlocked", player.UserIDString, itemCraftTask.blueprint.targetItem.displayName.english));
                return false;
            }

            if (permission.UserHasPermission(player.UserIDString, PermUse))
                return null;

            if (config.AllowByDefault)
                return null;

            player.ChatMessage(Msg("NoPermission", player.UserIDString));
            return false;
        }
    }
}

The plugin registers a single permission, fasttrackpermission.use, in Init. When a player clicks fast-track on a queued job, CanFastTrackCraftTask resolves the owning BasePlayer from the ItemCrafter component and checks the permission. Players without it get a localized chat message and the hook returns false, which stops the game from moving the job forward. Authorized players get true, so the vanilla fast-track runs, including its resource cost. The chat reply is rate-limited by nothing here because the hook only fires on an explicit button click, not on a tick or damage event.

Common use cases

  • VIP-only fast-track

    Gate the fast-track button behind a permission given to paid ranks, turning instant crafting into a server perk.

  • Disable fast-track for specific items

    Return false when itemCraftTask.blueprint.targetItem.shortname matches a sensitive item such as explosives or turrets, while leaving everything else untouched.

  • Disable fast-track entirely

    Return false for every call to remove the button's effect on a hardcore progression server without touching the client UI.

Pitfalls

  • Do not type the first parameter as BasePlayer

    The game passes an ItemCrafter component. Declaring BasePlayer makes Oxide skip the hook because the argument is not a player instance, so your logic never runs.

  • Returning null keeps vanilla fast-track

    Only a bool return is honored. If you forget to return false when blocking, the game completes the task anyway.

  • The hook does not fire for the first task

    The injection sits after the check that rejects the head of the queue, so the most recent job cannot be fast-tracked and your hook will not see it.

Build a plugin with CanFastTrackCraftTask

Describe what should happen and get a compiled plugin that uses this hook.

Prompt: VIP-only fast-track using the CanFastTrackCraftTask hook, with a config file and a permission
Generate this plugin

Edit the prompt on the next screen. 2 free plugins a month, no card.

Last updated Oct 26, 2026. Found a mistake? Email support@rustplugingenerator.com.

Build a plugin with CanFastTrackCraftTask

Generate